Skip to content

Commit

Permalink
Added e2e test and updated docs
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Avelar <[email protected]>
  • Loading branch information
felipe-avelar committed Apr 27, 2021
1 parent 226561e commit 6c2338b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ kics scan --config kics-config.json
kics scan
```

**Note**: If more than one path is given, KICS will warn that `--config` must be used to explicit decide
which config file should be used and will not load any configuration file as code.
**Note**: If more than one path is given, KICS will warn that `--config` must be used to explicit decide.

#### Environment variables
KICS also accepts environment variables to fill flags values. To use it you just need to have the flag with a `KICS_` prefix. For example:
Expand Down
16 changes: 15 additions & 1 deletion e2e/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var tests = []struct {
args: args{
args: []cmdArgs{
[]string{"scan", "--silent", "-q", "../assets/queries", "-p", "fixtures/samples/terraform.tf",
"--payload-path", "fixtures/payload.json", "-q", "../assets/queries"},
"--payload-path", "fixtures/payload.json"},
},
expectedOut: []string{
"E2E_CLI_005",
Expand Down Expand Up @@ -297,6 +297,20 @@ var tests = []struct {
},
wantStatus: 126,
},
// E2E-CLI-018 - KICS scan with multiple paths
{
name: "E2E-CLI-018",
args: args{
args: []cmdArgs{
[]string{"scan", "--silent", "-q", "../assets/queries", "-p", "fixtures/samples/terraform.tf,fixtures/samples/terraform-single.tf"},
},
expectedOut: []string{
"E2E_CLI_018",
},
},
wantStatus: 50,
removePayload: []string{"payload.json"},
},
}

func Test_E2E_CLI(t *testing.T) {
Expand Down
Empty file added e2e/fixtures/E2E_CLI_018
Empty file.

0 comments on commit 6c2338b

Please sign in to comment.