Skip to content

Fix PHPT coverage from phpdbg#3199

Merged
sebastianbergmann merged 8 commits into
sebastianbergmann:7.2from
kabel:bugfix/3111
Jul 9, 2018
Merged

Fix PHPT coverage from phpdbg#3199
sebastianbergmann merged 8 commits into
sebastianbergmann:7.2from
kabel:bugfix/3111

Conversation

@kabel

@kabel kabel commented Jul 7, 2018

Copy link
Copy Markdown
Contributor

Fixes #3111.
Stop using auto_append_file as it doesn't work with the phpdbg sapi.
Instead, the job's code is written to a temp file and the coverage instrumentation code takes over the code.

kabel added 2 commits July 6, 2018 21:07
Fixes #3111.
Stop using auto_append_file as it doesn't work with the phpdbg sapi.
Instead, the job's code is written to a temp file and the coverage instrumentation code takes over the code.
@codecov-io

codecov-io commented Jul 7, 2018

Copy link
Copy Markdown

Codecov Report

Merging #3199 into 7.2 will increase coverage by <.01%.
The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##                7.2    #3199      +/-   ##
============================================
+ Coverage     81.41%   81.41%   +<.01%     
- Complexity     3388     3391       +3     
============================================
  Files           137      137              
  Lines          8974     8976       +2     
============================================
+ Hits           7306     7308       +2     
  Misses         1668     1668
Impacted Files Coverage Δ Complexity Δ
src/Util/Filter.php 87.8% <100%> (+0.3%) 21 <0> (+2) ⬆️
src/Util/PHP/AbstractPhpProcess.php 71.12% <100%> (+0.41%) 40 <0> (+1) ⬆️
src/Runner/PhptTestCase.php 79.26% <87.5%> (-0.56%) 80 <5> (ø)
src/Util/GlobalState.php 94.73% <0%> (+1.31%) 36% <0%> (ø) ⬇️

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 c1a87c0...608262b. Read the comment docs.

kabel added 4 commits July 7, 2018 17:59
Fixes the following differences when running with phpdbg:

* phpdbg doesn't ignore the -- argument separator when passed to php
* phpdbg doesn't support display_errors=stderr, so errors go to STDOUT
* Tests that enable xdebug.scream affect process isolation in phpdbg
* Errors/Exceptions/Stacks are formatted slightly different in phpdbg
Also disables xdebug for phpdbg run
Comment thread .travis.yml Outdated
script:
- ./phpunit --coverage-clover=coverage.xml
- phpenv config-rm xdebug.ini; true
- phpdbg -qrr ./phpunit --coverage-text

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of running the tests once collecting code coverage data using Xdebug and once collecting code coverage data using PHPDBG?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just the quickest way I came up with for testing the code coverage through phpdbg use case and ensuring all the tests passed through the sapi. I can certainly take it out if you think it doesn't provide any future value.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please.

kabel added 2 commits July 8, 2018 11:26
* Gets rid of the need for eval-stdin.php in phpdbg with the s option
* Only include the args separator when a file is not given
@sebastianbergmann sebastianbergmann merged commit 34b954a into sebastianbergmann:7.2 Jul 9, 2018
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.

3 participants