taiki-e / cargo-llvm-cov

Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Apache License 2.0
858 stars 57 forks source link

Skip merging profraw data if profraw files don't exist and a profdata file already exists #360

Closed weiznich closed 3 months ago

weiznich commented 3 months ago

This change allows skipping merging the profraw data if a profdata file already exists. For distributed test runs (like for example nextests partitions) this allows merging the profraw files manually on each runner and only transfer the much smaller profdata file to the final job. There we can just merge the different profdata files manually and place it in the correct location. By allowing tho skip this check we can then use the existing cargo-llvm-cov infrastructure to generate reports.

taiki-e commented 3 months ago

Thanks for the PR!

For distributed test runs (like for example nextests partitions) this allows merging the profraw files manually on each runner and only transfer the much smaller profdata file to the final job.

This seems to solve https://github.com/taiki-e/cargo-llvm-cov/issues/281 (cc @TriplEight)?

taiki-e commented 3 months ago

@weiznich

This change allows skipping merging the profraw data if a profdata file already exists.

Does this describe exactly the behavior you intended? In that case, I think this patch is incorrect. What this patch does is "skip merging profraw files if profraw files don't exist and a profdata file already exists". It should work as is for your use case, but just in case.

weiznich commented 3 months ago

Yes that's correct, I've updated the PR description to make that more clear.

taiki-e commented 3 months ago

Published in 0.6.9.

TriplEight commented 2 months ago

@taiki-e let me some time to rebase and re-run my tests again, I'll answer you then