Skip to content

Commit b4472cb

Browse files
committed
Fix waitForSchema for group-less resources
1 parent 58ee69a commit b4472cb

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

tests/integration/column_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (i *IntegrationSuite) testColumnsScenario(ctx context.Context, scenario str
7474
defer i.doManifestReversed(ctx, scenarioTests, i.doDelete)
7575

7676
for gvr := range gvrs {
77-
i.waitForSchema(baseURL, fmt.Sprintf("%s.%s", gvr.Group, gvr.Resource))
77+
i.waitForSchema(baseURL, gvr)
7878
}
7979

8080
defer i.maybeStopAndDebug(baseURL)

tests/integration/filtering_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (i *IntegrationSuite) testFilterScenario(ctx context.Context, scenario stri
6262
defer i.doManifestReversed(ctx, scenarioManifests, i.doDelete)
6363

6464
for gvr := range gvrs {
65-
i.waitForSchema(baseURL, fmt.Sprintf("%s.%s", gvr.Group, gvr.Resource))
65+
i.waitForSchema(baseURL, gvr)
6666
}
6767

6868
defer i.maybeStopAndDebug(baseURL)

tests/integration/integration_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,13 @@ func (i *IntegrationSuite) doManifestWithHeader(ctx context.Context, manifestFil
231231
}
232232
}
233233

234-
func (i *IntegrationSuite) waitForSchema(baseURL string, schema string) {
234+
func (i *IntegrationSuite) waitForSchema(baseURL string, gvr schema.GroupVersionResource) {
235+
schemaID := fmt.Sprintf("%s.%s", gvr.Group, gvr.Resource)
236+
if gvr.Group == "" {
237+
schemaID = gvr.Resource
238+
}
235239
i.Require().EventuallyWithT(func(c *assert.CollectT) {
236-
url := baseURL + "/v1/schemaDefinitions/" + schema
240+
url := baseURL + "/v1/schemaDefinitions/" + schemaID
237241
resp, err := http.Get(url)
238242
require.NoError(c, err)
239243
defer resp.Body.Close()

tests/integration/sorting_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (i *IntegrationSuite) testSortScenario(ctx context.Context, scenario string
6262
defer i.doManifestReversed(ctx, scenarioManifests, i.doDelete)
6363

6464
for gvr := range gvrs {
65-
i.waitForSchema(baseURL, fmt.Sprintf("%s.%s", gvr.Group, gvr.Resource))
65+
i.waitForSchema(baseURL, gvr)
6666
}
6767

6868
defer i.maybeStopAndDebug(baseURL)

0 commit comments

Comments
 (0)