Skip to content

Commit

Permalink
fix: test_sec_audit: ignore cargo audit output
Browse files Browse the repository at this point in the history
Since we run this test twice in case of a PR, cargo audit locks the
database and one of the processes may print something (even with -q
specified) in stdout (‽). I believe this should be printed in stderr,
but we can workaround it here easily.

    warning: directory /usr/local/rust/advisory-db is locked
    {...}

Use `grep` to filter out the extraneous output.

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Jan 24, 2024
1 parent d7f8f4e commit 29a722a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration_tests/security/test_sec_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def set_of_vulnerabilities(output: CommandReturn):
)

git_ab_test_host_command_if_pr(
"cargo audit --deny warnings -q --json",
"cargo audit --deny warnings -q --json |grep -Po '{.*}'",
comparator=set_did_not_grow_comparator(set_of_vulnerabilities),
)

0 comments on commit 29a722a

Please sign in to comment.