Skip to content

Commit

Permalink
Refactor test asset directory look-up
Browse files Browse the repository at this point in the history
Simplify the look-up for the test asset directory. No need for path
cleaning function since it is a test case and the look-up is relative by
default, so there is no need to look-up the current working directory.
  • Loading branch information
HeavyWombat committed Jun 18, 2024
1 parent b83658f commit 9362315
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmd/image-processing/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,7 @@ var _ = Describe("Image Processing Resource", Ordered, func() {
})

Context("vulnerability scanning", func() {
var directory string
BeforeEach(func() {
cwd, err := os.Getwd()
Expect(err).ToNot(HaveOccurred())
directory = path.Clean(path.Join(cwd, "../..", "test/data/images/vuln-image-in-oci"))
})
directory := path.Join("..", "..", "test", "data", "images", "vuln-image-in-oci")

It("should run vulnerability scanning if it is enabled and output vulnerabilities equal to the limit defined", func() {
vulnOptions := &buildapi.VulnerabilityScanOptions{
Expand Down Expand Up @@ -491,7 +486,6 @@ var _ = Describe("Image Processing Resource", Ordered, func() {

_, err = remote.Get(ref)
Expect(err).To(HaveOccurred())

})
})

Expand Down Expand Up @@ -540,6 +534,5 @@ var _ = Describe("Image Processing Resource", Ordered, func() {
Expect(err).ToNot(HaveOccurred())
})
})

})
})

0 comments on commit 9362315

Please sign in to comment.