Skip to content

Commit

Permalink
test_coverage: put exclude_path value between double quotes
Browse files Browse the repository at this point in the history
We don't want the shell to interpret the contents of exclude_path,
but we want it all used as a single string for `--ignore-filename-regex`,
so let's put it between double quotes.

An example of failure is when we have | , as in this case:

  $ CARGO_TARGET_DIR=./cov_build cargo llvm-cov test --summary-only \
      --ignore-filename-regex crates/virtio-bindings|crates/virtio-queue/src/mock.rs \
      --workspace  --features=virtio-blk/backend-stdio
  bash: crates/virtio-queue/src/mock.rs: Permission denied
  ...
  error: failed to generate report: process didn't exit successfully: ...
  (exit status: 74)

Signed-off-by: Stefano Garzarella <[email protected]>
  • Loading branch information
stefano-garzarella authored and roypat committed Oct 20, 2023
1 parent b6483eb commit 9699b4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integration_tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _get_current_coverage(coverage_config, no_cleanup, test_scope):

additional_exclude_path = coverage_config["exclude_path"]
if additional_exclude_path:
llvm_cov_command += f" --ignore-filename-regex {additional_exclude_path}"
llvm_cov_command += f" --ignore-filename-regex \"{additional_exclude_path}\""

if test_scope == pytest.workspace:
llvm_cov_command += " --workspace "
Expand Down

0 comments on commit 9699b4d

Please sign in to comment.