fix(tests): normalize whitespace in plugin and hub sync test files

This commit is contained in:
GitHub Actions
2026-01-08 12:44:13 +00:00
parent 277b7b53ee
commit f40e4805d6
2 changed files with 20 additions and 20 deletions
@@ -35,16 +35,16 @@ func TestPluginHandler_ListPlugins(t *testing.T) {
// Create a failed plugin in DB
failedPlugin := models.Plugin{
UUID: "plugin-uuid-1",
Name: "Failed Plugin",
Type: "failed-type",
Enabled: false,
Status: models.PluginStatusError,
Error: "Failed to load",
Version: "1.0.0",
Author: "Test Author",
FilePath: "/path/to/plugin.so",
LoadedAt: nil,
UUID: "plugin-uuid-1",
Name: "Failed Plugin",
Type: "failed-type",
Enabled: false,
Status: models.PluginStatusError,
Error: "Failed to load",
Version: "1.0.0",
Author: "Test Author",
FilePath: "/path/to/plugin.so",
LoadedAt: nil,
}
db.Create(&failedPlugin)
@@ -301,7 +301,7 @@ func TestPluginHandler_DisablePlugin_AlreadyDisabled(t *testing.T) {
responseBody := w.Body.String()
assert.True(t,
strings.Contains(responseBody, "already disabled") ||
strings.Contains(responseBody, "disabled successfully"),
strings.Contains(responseBody, "disabled successfully"),
"Expected message about already disabled or successful disable, got: %s", responseBody)
}
@@ -649,8 +649,8 @@ func TestPluginHandler_EnablePlugin_WithLoadError(t *testing.T) {
// since the plugin is enabled in DB regardless of load success
assert.True(t,
strings.Contains(responseBody, "enabled but failed to load") ||
strings.Contains(responseBody, "enabled successfully") ||
strings.Contains(responseBody, "already enabled"),
strings.Contains(responseBody, "enabled successfully") ||
strings.Contains(responseBody, "already enabled"),
"Expected success or load failure message, got: %s", responseBody)
// Verify database was updated
+7 -7
View File
@@ -2034,10 +2034,10 @@ func TestExtractTarGz_SpecialCharactersInFilenames(t *testing.T) {
targetDir := t.TempDir()
files := map[string]string{
"file with spaces.txt": "content 1",
"file-with-dashes.yaml": "content 2",
"file with spaces.txt": "content 1",
"file-with-dashes.yaml": "content 2",
"file_with_underscores.yml": "content 3",
"file.multiple.dots.txt": "content 4",
"file.multiple.dots.txt": "content 4",
}
archive := makeTarGz(t, files)
@@ -2277,9 +2277,9 @@ func TestPeekFirstYAML_FindsYAML(t *testing.T) {
t.Parallel()
svc := NewHubService(nil, nil, t.TempDir())
archive := makeTarGz(t, map[string]string{
"readme.txt": "readme content",
"config.yaml": "name: test\nversion: 1.0",
"another.yml": "other: config",
"readme.txt": "readme content",
"config.yaml": "name: test\nversion: 1.0",
"another.yml": "other: config",
})
result := svc.peekFirstYAML(archive)
@@ -2291,7 +2291,7 @@ func TestPeekFirstYAML_NoYAMLFiles(t *testing.T) {
t.Parallel()
svc := NewHubService(nil, nil, t.TempDir())
archive := makeTarGz(t, map[string]string{
"readme.txt": "readme",
"readme.txt": "readme",
"config.json": "{}",
})