Skip to content

Commit

Permalink
fix: metadata test
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet committed Sep 22, 2023
1 parent ba0de66 commit 3bd9b5e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions e2e/flags/.snapshots/TestMetadataFlags-help-scan
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Scan Flags
--exit-code int Force a given exit code for the scan command. Set this to 0 (success) to always return a success exit code despite any findings from the scan. (default -1)
--external-rule-dir strings Specify directories paths that contain .yaml files with external rules configuration
--force Disable the cache and runs the detections again
--hide-progress-bar Hide progress bar from output
--internal-domains strings Define regular expressions for better classification of private or unreachable domains e.g. --internal-domains=".*.my-company.com,private.sh"
--parallel int Specify the amount of parallelism to use during the scan
--quiet Suppress non-essential messages
Expand Down
10 changes: 9 additions & 1 deletion e2e/flags/metadata_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import (
)

func newMetadataTest(name string, arguments []string) testhelper.TestCase {
return testhelper.NewTestCase(name, arguments, testhelper.TestCaseOptions{DisplayStdErr: true, IgnoreForce: true})
return testhelper.NewTestCase(
name,
arguments,
testhelper.TestCaseOptions{
DisplayStdErr: true,
IgnoreForce: true,
DisplayProgressBar: true,
},
)
}

func TestMetadataFlags(t *testing.T) {
Expand Down
18 changes: 10 additions & 8 deletions e2e/internal/testhelper/testhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ type TestCase struct {
}

type TestCaseOptions struct {
DisplayStdErr bool
IgnoreForce bool
DisplayStdErr bool
DisplayProgressBar bool
IgnoreForce bool
}

func NewTestCase(name string, arguments []string, options TestCaseOptions) TestCase {
return TestCase{
name: name,
arguments: arguments,
ShouldSucceed: true,
options: options,
displayStdErr: options.DisplayStdErr,
ignoreForce: options.IgnoreForce,
name: name,
arguments: arguments,
ShouldSucceed: true,
options: options,
displayStdErr: options.DisplayStdErr,
displayProgressBar: options.DisplayProgressBar,
ignoreForce: options.IgnoreForce,
}
}

Expand Down

0 comments on commit 3bd9b5e

Please sign in to comment.