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 logging of TestSuite setup failures #3428

Merged
merged 10 commits into from Nov 30, 2018
Merged

Fix logging of TestSuite setup failures #3428

merged 10 commits into from Nov 30, 2018

Conversation

epdenouden
Copy link
Contributor

@epdenouden epdenouden commented Nov 29, 2018

Fixes #3364

If setUpBeforeClass failed, the TestSuite would send its own details to the listeners for each test, instead of details about individual failing tests. Fixing this makes the errors visible again including code location hints and exception messages.

It also corrects the reported number of tests that are run in case of setup failure when running with --stop-on-error.

Output in IntelliJ 2018.3 using TeamCity:

image

This also works for other log formats. Default printer:

./phpunit tests/end-to-end/regression/GitHub/3364/tests

[...]
There were 4 errors:

1) Issue3364SetupBeforeClassTest::testOneWithClassSetupException
RuntimeException: throw exception in setUpBeforeClass in /Users/ewout/proj/phpunit-new-order/tests/end-to-end/regression/GitHub/3364/tests/Issue3364SetupBeforeClassTest.php:18
Stack trace:
#0 /Users/ewout/proj/phpunit-new-order/src/Framework/TestSuite.php(703): Issue3364SetupBeforeClassTest::setUpBeforeClass()

TestDox:

./phpunit --testdox tests/end-to-end/regression/GitHub/3364/tests

[...]
Issue3364SetupBeforeClass
 ✘ One with class setup exception [0.00 ms]
   │
   │ RuntimeException: throw exception in setUpBeforeClass in /Users/ewout/proj/phpunit-new-order/tests/end-to-end/regression/GitHub/3364/tests/Issue3364SetupBeforeClassTest.php:18
   │ Stack trace:
   │ #0 /Users/ewout/proj/phpunit-new-order/src/Framework/TestSuite.php(703): Issue3364SetupBeforeClassTest::setUpBeforeClass()

@codecov
Copy link

codecov bot commented Nov 29, 2018

Codecov Report

Merging #3428 into 7.5 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                7.5    #3428      +/-   ##
============================================
+ Coverage     83.24%   83.24%   +<.01%     
+ Complexity     3629     3628       -1     
============================================
  Files           143      143              
  Lines          9660     9653       -7     
============================================
- Hits           8041     8036       -5     
+ Misses         1619     1617       -2
Impacted Files Coverage Δ Complexity Δ
src/Util/TestDox/CliTestDoxPrinter.php 95.5% <ø> (-0.13%) 62 <0> (-1)
src/Framework/TestSuite.php 84.78% <100%> (-0.65%) 148 <0> (ø)
src/Util/Log/TeamCity.php 55.27% <0%> (+2.48%) 62% <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 420d8ca...5d53583. Read the comment docs.

@sebastianbergmann sebastianbergmann merged commit 654f7c7 into sebastianbergmann:7.5 Nov 30, 2018
@epdenouden epdenouden deleted the issue-3364-show-testsuite-setup-failures branch November 30, 2018 14:13
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