Skip to content

Commit 897adc4

Browse files
Merge pull request #15779 from miminar/registry-extended-test-fixes
Automatic merge from submit-queue extended: Skip test instead of failing When server configuration cannot be determined. When the extended test is run with `TEST_ONLY=true` (the origin cluster is expected to be configured and run separately), some environment variables do not get exported to extended test binary. Let's skip test requiring them.
2 parents b020659 + 9ea980e commit 897adc4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/extended/imageapis/limitrange_admission.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,14 @@ var _ = g.Describe("[Feature:ImageQuota] Image limit range", func() {
184184

185185
g.It(fmt.Sprintf("should deny an import of a repository exceeding limit on %s resource", imageapi.ResourceImageStreamTags), func() {
186186
oc.SetOutputDir(exutil.TestContext.OutputDir)
187-
defer tearDown(oc)
188187

189188
maxBulkImport, err := getMaxImagesBulkImportedPerRepository()
190-
o.Expect(err).NotTo(o.HaveOccurred())
189+
if err != nil {
190+
g.Skip(err.Error())
191+
return
192+
}
193+
194+
defer tearDown(oc)
191195

192196
s1tag2Image, err := buildAndPushTestImagesTo(oc, "src1st", "tag", maxBulkImport+1)
193197
s2tag2Image, err := buildAndPushTestImagesTo(oc, "src2nd", "t", 2)
@@ -309,7 +313,7 @@ func bumpLimit(oc *exutil.CLI, resourceName kapi.ResourceName, limit string) (ka
309313
func getMaxImagesBulkImportedPerRepository() (int, error) {
310314
max := os.Getenv("MAX_IMAGES_BULK_IMPORTED_PER_REPOSITORY")
311315
if len(max) == 0 {
312-
return 0, fmt.Errorf("MAX_IMAGES_BULK_IMAGES_IMPORTED_PER_REPOSITORY needs to be set")
316+
return 0, fmt.Errorf("MAX_IMAGES_BULK_IMAGES_IMPORTED_PER_REPOSITORY is not set")
313317
}
314318
return strconv.Atoi(max)
315319
}

0 commit comments

Comments
 (0)