Skip to content

Commit

Permalink
extended: Skip test instead of failing
Browse files Browse the repository at this point in the history
When server configuration cannot be determined.

Signed-off-by: Michal Minář <[email protected]>
  • Loading branch information
Michal Minář committed Aug 15, 2017
1 parent 7ded232 commit 9ea980e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/extended/imageapis/limitrange_admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,14 @@ var _ = g.Describe("[Feature:ImageQuota] Image limit range", func() {

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

maxBulkImport, err := getMaxImagesBulkImportedPerRepository()
o.Expect(err).NotTo(o.HaveOccurred())
if err != nil {
g.Skip(err.Error())
return
}

defer tearDown(oc)

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

0 comments on commit 9ea980e

Please sign in to comment.