From 9699b4dfe34052df9064dd80c8b808274f81aaeb Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Thu, 19 Oct 2023 09:58:04 +0200 Subject: [PATCH] test_coverage: put exclude_path value between double quotes 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 --- integration_tests/test_coverage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/test_coverage.py b/integration_tests/test_coverage.py index 1a7fd3b..00beacd 100644 --- a/integration_tests/test_coverage.py +++ b/integration_tests/test_coverage.py @@ -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 "