Skip to content

Commit e7ae239

Browse files
committed
fix(test): make test_cargo_audit not ignore return code outside A/B
The pipe through grep was causing any return code of cargo audit to be overwritten with that of grep (which is always 0). Fix this by using `-o pipefail`, which changes the return code of a bash pipe to instead be that of the rightmost failing command (or 0 if none fail). Note that just -o pipefail will not abort the pipe on a non-zero code (so the grep will still run even if cargo audit fails). Suggested-by: Riccardo Mancini <[email protected]> Signed-off-by: Patrick Roy <[email protected]>
1 parent 2392fe9 commit e7ae239

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/integration_tests/security/test_sec_audit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def set_of_vulnerabilities(output: CommandReturn):
3535
)
3636

3737
git_ab_test_host_command_if_pr(
38-
"cargo audit --deny warnings -q --json |grep -Po '{.*}'",
38+
"bash -o pipefail -c \"cargo audit --deny warnings -q --json |grep -Po '{.*}'\"",
3939
comparator=set_did_not_grow_comparator(set_of_vulnerabilities),
4040
)

0 commit comments

Comments
 (0)