Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coverage failure in case of an invalid file #973

Closed
wants to merge 1 commit into from
Closed

Fix coverage failure in case of an invalid file #973

wants to merge 1 commit into from

Conversation

mabar
Copy link

@mabar mabar commented Dec 23, 2022

My lib supports two incompatible versions of a dependency. Code for newer version extends class that does not exist in older one. Currently code coverage fails with Uncaught Error: Class 'Latte\Extension' not found https://github.com/orisai/localization/actions/runs/3766553046/jobs/6403184303

After applying the fix, coverage no longer fails. And file is correctly reported as uncovered.
orisai/localization@a0f7a0b
https://github.com/orisai/localization/actions/runs/3766885353

@codecov
Copy link

codecov bot commented Dec 23, 2022

Codecov Report

Merging #973 (7fc2f90) into 9.2 (709ee60) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##                9.2     #973      +/-   ##
============================================
- Coverage     84.29%   84.28%   -0.01%     
- Complexity     1178     1184       +6     
============================================
  Files            59       59              
  Lines          4215     4220       +5     
============================================
+ Hits           3553     3557       +4     
- Misses          662      663       +1     
Impacted Files Coverage Δ
src/CodeCoverage.php 48.87% <0.00%> (-0.19%) ⬇️
...c/StaticAnalysis/ExecutableLinesFindingVisitor.php 98.92% <0.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mabar
Copy link
Author

mabar commented Feb 13, 2023

@sebastianbergmann Could you check that please? Thank you

@sebastianbergmann
Copy link
Owner

I did not have time yet to review this. In the meantime, please fix the coding guidlines violations. Thanks!

@mabar
Copy link
Author

mabar commented Feb 13, 2023

please fix the coding guidlines violations

I hope I did it correctly. I don't know because even composer update fails on my machine and I have to wait for workflow approval.

You could change settings for approval on page https://github.com/sebastianbergmann/php-code-coverage/settings/actions so only new GitHub users have to wait
image

Composer reports this

mabar@pc:~/www/libs/phpunit/php-code-coverage$ php ./tools/composer update --no-ansi --no-interaction --no-progress
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpunit/phpunit[9.3.0, ..., 9.3.3] require phpunit/php-code-coverage ^9.0 -> satisfiable by phpunit/php-code-coverage[9.0.0, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit[9.3.4, ..., 9.3.7] require phpunit/php-code-coverage ^9.1.1 -> satisfiable by phpunit/php-code-coverage[9.1.1, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit[9.3.8, ..., 9.3.10] require phpunit/php-code-coverage ^9.1.5 -> satisfiable by phpunit/php-code-coverage[9.1.5, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit 9.3.11 requires phpunit/php-code-coverage ^9.1.11 -> satisfiable by phpunit/php-code-coverage[9.1.11, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit[9.4.0, ..., 9.4.4] require phpunit/php-code-coverage ^9.2 -> satisfiable by phpunit/php-code-coverage[9.2.0, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit[9.5.0, ..., 9.5.9] require phpunit/php-code-coverage ^9.2.3 -> satisfiable by phpunit/php-code-coverage[9.2.3, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit[9.5.10, ..., 9.5.14] require phpunit/php-code-coverage ^9.2.7 -> satisfiable by phpunit/php-code-coverage[9.2.7, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - phpunit/phpunit[9.5.16, ..., 9.6.3] require phpunit/php-code-coverage ^9.2.13 -> satisfiable by phpunit/php-code-coverage[9.2.13, ..., 9.2.x-dev] from composer repo (https://repo.packagist.org) but phpunit/php-code-coverage is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - Root composer.json requires phpunit/phpunit ^9.3 -> satisfiable by phpunit/phpunit[9.3.0, ..., 9.6.3].

@mabar
Copy link
Author

mabar commented Nov 27, 2023

Well, apparently only thing I needed was to set processUncoveredFiles to false 🤦

@mabar mabar closed this Nov 27, 2023
@mabar mabar deleted the patch-2 branch November 27, 2023 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants