Skip to content

Commit

Permalink
fixed e2e test cases for --config-only
Browse files Browse the repository at this point in the history
  • Loading branch information
devang-gaur committed Jul 13, 2021
1 parent 0bc0ac1 commit 4dc9e31
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/e2e/scan/scan_config_only_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ var _ = Describe("Scan With Config Only Flag", func() {
Context("for terraform files", func() {
When("output type is json", func() {
Context("it supports --config-only flag", func() {
It("should display config json and exit with status code 3", func() {
It("should display config json and exit with status code 0", func() {
scanArgs := []string{scanUtils.ScanCommand, "-d", iacDir, "--config-only", "-o", "json"}
session = helper.RunCommand(terrascanBinaryPath, outWriter, errWriter, scanArgs...)
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeThree))
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeZero))
})
})
})

When("output type is yaml", func() {
Context("it supports --config-only flag", func() {
It("should display config json and exit with status code 3", func() {
It("should display config json and exit with status code 0", func() {
scanArgs := []string{scanUtils.ScanCommand, "-d", iacDir, "--config-only", "-o", "yaml"}
session = helper.RunCommand(terrascanBinaryPath, outWriter, errWriter, scanArgs...)
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeThree))
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeZero))
})
})
})
Expand All @@ -110,20 +110,20 @@ var _ = Describe("Scan With Config Only Flag", func() {
})
When("output type is json", func() {
Context("it supports --config-only flag", func() {
It("should display config json and exit with status code 3", func() {
It("should display config json and exit with status code 0", func() {
scanArgs := []string{scanUtils.ScanCommand, "-d", iacDir, "--config-only", "-o", "json", "-i", "k8s"}
session = helper.RunCommand(terrascanBinaryPath, outWriter, errWriter, scanArgs...)
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeThree))
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeZero))
})
})
})

When("output type is yaml", func() {
Context("it supports --config-only flag", func() {
It("should display config json and exit with status code 3", func() {
It("should display config json and exit with status code 0", func() {
scanArgs := []string{scanUtils.ScanCommand, "-d", iacDir, "--config-only", "-o", "yaml", "-i", "k8s"}
session = helper.RunCommand(terrascanBinaryPath, outWriter, errWriter, scanArgs...)
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeThree))
Eventually(session, scanUtils.ScanTimeout).Should(gexec.Exit(helper.ExitCodeZero))
})
})
})
Expand Down

0 comments on commit 4dc9e31

Please sign in to comment.