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

Restore PHPT code coverage support #2810

Merged
merged 5 commits into from Oct 16, 2017

Conversation

3 participants
@kabel
Contributor

kabel commented Oct 16, 2017

Fixes #2175. Because files added by require and auto_prepend_file features both end up in the included files list from GlobalState, a new global variable was necessary to purposely ignore those files, otherwise you'll run into an infinite loop when doing tests in process isolation.

Also cleans up some of the complexity issues reported in phpmd.

kabel added some commits Oct 15, 2017

AbstratPhpProcess should escape shell agruments for settings
These ini settings could potentially contain spaces or other characters
that would change the meaning of the process invokation.
Restore code coverage to phpt files
Coverage is enabled through an auto_prepend_file setting.
GlobalState was changed to allow blacklisting the coverage enabling
template file and the user requested prepend file. This ensures that
these files are not repeatedly included in process isolation runs
(infinate loop otherwise).
Fix php process settings test on windows
The shell escape character is different.
@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Oct 16, 2017

Codecov Report

Merging #2810 into master will increase coverage by 24.57%.
The diff coverage is 84.21%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #2810       +/-   ##
============================================
+ Coverage     54.82%   79.4%   +24.57%     
- Complexity     2807    2835       +28     
============================================
  Files           104     104               
  Lines          7828    7896       +68     
============================================
+ Hits           4292    6270     +1978     
+ Misses         3536    1626     -1910
Impacted Files Coverage Δ Complexity Δ
src/Util/PHP/AbstractPhpProcess.php 72.84% <100%> (+14.56%) 41 <0> (ø) ⬇️
src/Util/GlobalState.php 93.75% <66.66%> (+0.24%) 37 <0> (+2) ⬆️
src/Runner/PhptTestCase.php 78.66% <84.49%> (+11.79%) 81 <38> (+26) ⬆️
src/Util/Configuration.php 87.63% <0%> (+2.93%) 159% <0%> (ø) ⬇️
src/Util/Test.php 94.42% <0%> (+5.57%) 196% <0%> (ø) ⬇️
src/Util/Filter.php 84.09% <0%> (+6.81%) 21% <0%> (ø) ⬇️
src/Util/Fileloader.php 100% <0%> (+10%) 7% <0%> (ø) ⬇️
src/Framework/TestCase.php 66.33% <0%> (+10.29%) 314% <0%> (ø) ⬇️
... and 34 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 3653ae8...9474c74. Read the comment docs.

codecov-io commented Oct 16, 2017

Codecov Report

Merging #2810 into master will increase coverage by 24.57%.
The diff coverage is 84.21%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #2810       +/-   ##
============================================
+ Coverage     54.82%   79.4%   +24.57%     
- Complexity     2807    2835       +28     
============================================
  Files           104     104               
  Lines          7828    7896       +68     
============================================
+ Hits           4292    6270     +1978     
+ Misses         3536    1626     -1910
Impacted Files Coverage Δ Complexity Δ
src/Util/PHP/AbstractPhpProcess.php 72.84% <100%> (+14.56%) 41 <0> (ø) ⬇️
src/Util/GlobalState.php 93.75% <66.66%> (+0.24%) 37 <0> (+2) ⬆️
src/Runner/PhptTestCase.php 78.66% <84.49%> (+11.79%) 81 <38> (+26) ⬆️
src/Util/Configuration.php 87.63% <0%> (+2.93%) 159% <0%> (ø) ⬇️
src/Util/Test.php 94.42% <0%> (+5.57%) 196% <0%> (ø) ⬇️
src/Util/Filter.php 84.09% <0%> (+6.81%) 21% <0%> (ø) ⬇️
src/Util/Fileloader.php 100% <0%> (+10%) 7% <0%> (ø) ⬇️
src/Framework/TestCase.php 66.33% <0%> (+10.29%) 314% <0%> (ø) ⬇️
... and 34 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 3653ae8...9474c74. Read the comment docs.

@sebastianbergmann sebastianbergmann added this to the PHPUnit 6.5 milestone Oct 16, 2017

@sebastianbergmann sebastianbergmann merged commit 8b583a8 into sebastianbergmann:master Oct 16, 2017

5 checks passed

codecov/patch 84.21% of diff hit (target 54.82%)
Details
codecov/project 79.4% (+24.57%) compared to 3653ae8
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
stickler-ci No lint errors found.

@OndraM OndraM referenced this pull request Mar 6, 2018

Open

Add code coverage #29

@kabel kabel deleted the kabel:phpt-coverage branch Mar 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment