diff --git a/backend/internal/crowdsec/hub_sync_test.go b/backend/internal/crowdsec/hub_sync_test.go index 6326fbea..b8427cc8 100644 --- a/backend/internal/crowdsec/hub_sync_test.go +++ b/backend/internal/crowdsec/hub_sync_test.go @@ -72,7 +72,7 @@ func makeTarGz(t *testing.T, files map[string]string) []byte { return buf.Bytes() } -//go:embed testdata/hub_index.json testdata/hub_index_html.html +//go:embed testdata/hub_index_fixture.json testdata/hub_index_html.html var hubTestFixtures embed.FS func readFixture(t *testing.T, name string) string { @@ -102,7 +102,7 @@ func TestFetchIndexFallbackHTTP(t *testing.T) { exec := &recordingExec{errors: map[string]error{"cscli hub list -o json": fmt.Errorf("boom")}} cacheDir := t.TempDir() svc := NewHubService(exec, nil, cacheDir) - indexBody := readFixture(t, "hub_index.json") + indexBody := readFixture(t, "hub_index_fixture.json") hubServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path != defaultHubIndexPath { http.NotFound(w, r) diff --git a/backend/internal/crowdsec/testdata/hub_index_fixture.json b/backend/internal/crowdsec/testdata/hub_index_fixture.json new file mode 100644 index 00000000..caf7bebc --- /dev/null +++ b/backend/internal/crowdsec/testdata/hub_index_fixture.json @@ -0,0 +1,9 @@ +{ + "collections": { + "crowdsecurity/demo": { + "path": "crowdsecurity/demo.tgz", + "version": "1.0", + "description": "Demo collection" + } + } +}