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

Add option to exit with exit code 1 when no tests are executed #4314

Conversation

localheinz
Copy link
Collaborator

@localheinz localheinz commented Jun 22, 2020

This PR

  • adds a failOnEmptyTestSuite option which - when set - will fail a test run when no tests were found

Fixes #4313.

πŸ’β€β™‚οΈ I have tried adding an end-to-end test, but I'm unsure how to assert the exit code from a .phpt test. Is that even possible?

Disabled

Screen Shot 2020-06-23 at 21 28 56

Enabled

Screen Shot 2020-06-23 at 21 29 21

@codecov
Copy link

codecov bot commented Jun 22, 2020

Codecov Report

Merging #4314 into master will decrease coverage by 0.04%.
The diff coverage is 63.63%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4314      +/-   ##
============================================
- Coverage     84.65%   84.60%   -0.05%     
- Complexity     4569     4579      +10     
============================================
  Files           257      257              
  Lines         11500    11520      +20     
============================================
+ Hits           9735     9747      +12     
- Misses         1765     1773       +8     
Impacted Files Coverage Ξ” Complexity Ξ”
src/TextUI/CliArguments/Builder.php 79.95% <50.00%> (-0.30%) 113.00 <0.00> (+1.00) ⬇️
src/TextUI/CliArguments/Configuration.php 68.37% <50.00%> (-0.31%) 333.00 <86.00> (+4.00) ⬇️
src/TextUI/CliArguments/Mapper.php 79.35% <50.00%> (-0.39%) 77.00 <0.00> (+1.00) ⬇️
src/TextUI/TestRunner.php 63.65% <66.66%> (+0.01%) 221.00 <0.00> (+3.00)
src/TextUI/XmlConfiguration/Loader.php 98.07% <100.00%> (+<0.01%) 149.00 <0.00> (ΓΈ)
src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php 95.69% <100.00%> (+0.07%) 76.00 <10.00> (+1.00)

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 684e172...6ee76f7. Read the comment docs.

@localheinz localheinz changed the title Enhancement: Allow failing tests when test-suite is empty Enhancement: Allow failing tests when test suite is empty Jun 22, 2020
@localheinz localheinz force-pushed the feature/fail-on-empty-test-suite branch from 4cc33c7 to 04b1b3b Compare June 22, 2020 08:47
@localheinz localheinz marked this pull request as ready for review June 22, 2020 09:02
@sebastianbergmann sebastianbergmann changed the title Enhancement: Allow failing tests when test suite is empty Add option to exit with exit code 1 when no tests are executed Jun 23, 2020
@localheinz localheinz force-pushed the feature/fail-on-empty-test-suite branch from 04b1b3b to 99b3a65 Compare June 23, 2020 19:28
@localheinz localheinz force-pushed the feature/fail-on-empty-test-suite branch from 99b3a65 to 6ee76f7 Compare June 24, 2020 05:45
@sebastianbergmann sebastianbergmann merged commit e59ba3e into sebastianbergmann:master Jun 24, 2020
@localheinz localheinz deleted the feature/fail-on-empty-test-suite branch June 24, 2020 07:29
@localheinz
Copy link
Collaborator Author

Thank you, @sebastianbergmann!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optionally exit with exit code 1 when no tests are executed
3 participants