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

chore: Test snyk/scan commands with additional-arguments #109

Merged
merged 3 commits into from
Aug 14, 2023

Conversation

bencord0
Copy link

@bencord0 bencord0 commented Aug 10, 2023

The crux of this commit is this line.

test "$(cat /tmp/dry-run-snyk-commands.txt)" = "$(printf "<< parameters.expected-commands >>")"

A new parameter is created, test-only-param_dry-run-commands, which installs a shim to capture the command arguments passed to the snyk CLI.

Then, a validation step is run that compares the output of the commands the orb will run, vs the expected-commands.
An exact match string comparison is used, to set the result.

@bencord0 bencord0 requested a review from a team as a code owner August 10, 2023 17:28
@bencord0 bencord0 force-pushed the additional-monitor-arguments branch 7 times, most recently from e267dd8 to bc2726b Compare August 11, 2023 10:09
@bencord0 bencord0 force-pushed the additional-monitor-arguments branch from bc2726b to 2c3d55b Compare August 11, 2023 10:12
Copy link
Contributor

@bastiandoetsch bastiandoetsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting implementation and nice workaround to test limitations!

@bastiandoetsch bastiandoetsch merged commit 3b38d2b into develop Aug 14, 2023
@bastiandoetsch bastiandoetsch deleted the additional-monitor-arguments branch August 14, 2023 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants