php-code-coverage icon indicating copy to clipboard operation
php-code-coverage copied to clipboard

Coverage cache should use relative paths.

Open thirsch opened this issue 3 years ago • 2 comments

Q A
php-code-coverage version >= 9.2.17
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 9.5.25

The cache file lookup uses the absolute path of both, the cache scripts of this project (introduced here: https://github.com/sebastianbergmann/php-code-coverage/commit/acd254eb5eb09e26c2ec1bf407230d162d2db453) and the absolut path of covered file of the project under test. As we are running subsequent builds of our project in different paths (including the build number e.g.), we can't use the cache much, as every run causes a miss and would only produce tons of duplicates in a shared cache folder.

Would it be possible to change both path to use relative path to the files? As both methods are using the content of the file as well, it should be sufficient to build unique cache hashes. What do you think?

thirsch avatar Oct 20 '22 15:10 thirsch

Duplicate of https://github.com/sebastianbergmann/php-code-coverage/issues/925

Legion112 avatar Oct 21 '22 14:10 Legion112

Duplicate of #925

Not really.

sebastianbergmann avatar Oct 21 '22 15:10 sebastianbergmann