Skip to content

Commit

Permalink
use test data as path and updated tf vars to be relative
Browse files Browse the repository at this point in the history
  • Loading branch information
KylePeterDavies committed Nov 25, 2023
1 parent 8ca9c30 commit 3b26214
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 3 additions & 13 deletions test/data/tfvars.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SchemaVersion": 2,
"ArtifactName": ".",
"ArtifactName": "test/data",
"ArtifactType": "filesystem",
"Metadata": {
"ImageConfig": {
Expand All @@ -16,17 +16,7 @@
},
"Results": [
{
"Target": "Dockerfile",
"Class": "config",
"Type": "dockerfile",
"MisconfSummary": {
"Successes": 4,
"Failures": 0,
"Exceptions": 0
}
},
{
"Target": "test/data",
"Target": ".",
"Class": "config",
"Type": "terraform",
"MisconfSummary": {
Expand All @@ -36,7 +26,7 @@
}
},
{
"Target": "test/data/main.tf",
"Target": "main.tf",
"Class": "config",
"Type": "terraform",
"MisconfSummary": {
Expand Down
2 changes: 1 addition & 1 deletion test/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bats_load_library bats-file

@test "trivy config with terraform variables" {
# trivy config --format json --severity MEDIUM --output tfvars.test --tf-vars ./test/data/dev.tfvars ./test/data
run ./entrypoint.sh "-a config" "-j ./test/data" "-h tfvars.test" "-g MEDIUM" "-x ./test/data/dev.tfvars" "-b json"
run ./entrypoint.sh "-a config" "-j ./test/data" "-h tfvars.test" "-g MEDIUM" "-x dev.tfvars" "-b json"
run diff tfvars.test ./test/data/tfvars.test
echo "$output"
assert_files_equal tfvars.test ./test/data/tfvars.test
Expand Down

0 comments on commit 3b26214

Please sign in to comment.