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

Explicitly ignore lines containing Class/Trait/Interface tokens (again) #775

Conversation

dvdoug
Copy link
Contributor

@dvdoug dvdoug commented Jul 3, 2020

For #774

In currently released versions of php-code-coverage CodeCoverage->getLinesToBeIgnoredInner() is called for every file included in the whitelist. This was shared logic between files that were actually processed by a driver and uncovered files that were not. This had the effect that all files passed through our own version of an executable-code detector, which removed lines with class declarations.

In #757, this was refactored so that the inbuilt executable-code detector was only used for uncovered added files. For processed files, the driver's implementation is relied on.

However fixing that issue has revealed https://bugs.xdebug.org/view.php?id=1798 which was previously hidden. Depending on the precise execution path of the test suite, under Xdebug the class declaration in the affected files can show up as (1) non-executable (2) executable but covered by the first test that uses it (3) executable but uncovered. PCOV and PHPDBG are unaffected and always have behaviour (1).

This PR is a small partial revert of #757 to make class declarations always considered non-executable again regardless of what the driver data says.

@codecov
Copy link

codecov bot commented Jul 3, 2020

Codecov Report

Merging #775 into master will increase coverage by 1.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #775      +/-   ##
============================================
+ Coverage     82.18%   83.67%   +1.49%     
  Complexity      978      978              
============================================
  Files            58       50       -8     
  Lines          2963     2910      -53     
============================================
  Hits           2435     2435              
+ Misses          528      475      -53     
Impacted Files Coverage Δ Complexity Δ
src/CodeCoverage.php 55.35% <100.00%> (+0.16%) 123.00 <0.00> (ø)
src/RawCodeCoverageData.php 96.36% <0.00%> (-0.04%) 61.00% <0.00%> (ø%)
src/Driver/PhpdbgDriver.php 0.00% <0.00%> (ø) 13.00% <0.00%> (ø%)
src/Exception/TestIdMissingException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Exception/PcovNotAvailableException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Exception/Xdebug2NotEnabledException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Exception/Xdebug3NotEnabledException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Exception/PhpdbgNotAvailableException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Exception/XdebugNotAvailableException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
src/Exception/WriteOperationFailedException.php 0.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
... and 45 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f33b51...fec8fc6. Read the comment docs.

@sebastianbergmann sebastianbergmann merged commit 92c2b3b into sebastianbergmann:master Jul 4, 2020
@sebastianbergmann
Copy link
Owner

Thank you, @dvdoug.

@dvdoug dvdoug deleted the workaround_xdebug_inconsistency branch July 14, 2020 11:02
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.

2 participants