Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoke/fix broken test #1652

Merged
merged 2 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/smoke/spec/iac/snyk_test_directory_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Describe "Snyk iac test command"
Before snyk_login
After snyk_logout
Describe "terraform directory scan"
Skip if "execute only in regression test" check_if_regression_test
It "finds issues in terraform directory"
When run snyk iac test ../fixtures/iac/terraform/
The status should be failure # issues found
Expand Down
1 change: 1 addition & 0 deletions test/smoke/spec/iac/snyk_test_k8s_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Describe "Snyk iac test command"
After snyk_logout

Describe "k8s single file scan"
Skip if "execute only in regression test" check_if_regression_test
It "finds issues in k8s file"
When run snyk iac test ../fixtures/iac/kubernetes/pod-privileged.yaml
The status should be failure # issues found
Expand Down
1 change: 1 addition & 0 deletions test/smoke/spec/iac/snyk_test_local_exec_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Describe "Snyk iac test --experimental command"
After snyk_logout

Describe "k8s single file scan"
Skip if "execute only in regression test" check_if_regression_test
It "finds issues in k8s file"
When run snyk iac test ../fixtures/iac/kubernetes/pod-privileged.yaml --experimental
The status should be failure # issues found
Expand Down
1 change: 1 addition & 0 deletions test/smoke/spec/iac/snyk_test_terraform_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Describe "Snyk iac test command"
After snyk_logout

Describe "terraform single file scan"
Skip if "execute only in regression test" check_if_regression_test
It "finds issues in terraform file"
When run snyk iac test ../fixtures/iac/terraform/sg_open_ssh.tf
The status should be failure # issues found
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/spec/snyk_auth_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Describe "Snyk CLI Authorization"

# Using timeout to not wait for browser confirmation
When run timeout 5 snyk auth
The output should include "To authenticate your account, open the below URL in your browser."
The result of function check_auth_output should be success
The result of function verify_login_url should include "snyk.io/login?token=" # URL found
The status should be failure
# TODO: unusable with our current docker issues
Expand Down
5 changes: 5 additions & 0 deletions test/smoke/spec/spec_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ restore_is_ci_flags() {
}

check_if_regression_test() { ! [ "${REGRESSION_TEST}" = "1" ]; }

check_auth_output() {
printf %s "$1" | grep -F -e "To authenticate your account, open the below URL in your browser." -e "Now redirecting you to our auth page, go ahead and log in," > /dev/null
echo $?
}