phpunit-slow-test-detector
phpunit-slow-test-detector copied to clipboard
Add JUnit report logger
This pull request adds the ability to generate a JUnit log file for slow tests. Currently, when reviewing a PR, one must go to the CI output to see if there are any slow tests. Now, a JUnit log file can be generated instead and used with GitHub actions:
- name: Publish Slow Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
check_name: PHPUnit Slow Tests Report
annotate_only: 'true'
report_paths: ./slow-tests.xml
This makes it easier and more clear to spot slow tests:
To trigger the file generation, all that's required is to add the name of the file to phpunit.xml
:
<bootstrap class="Ergebnis\PHPUnit\SlowTestDetector\Extension">
<parameter name="junit-file" value="slow-tests.xml"/>
</bootstrap>
If PHPUnit is run with the --log-junit=
option and the junit-file
parameter is present, the JUnit log for slow tests is generated.
Later, if needed, other formats such as testdox could be added.
Codecov Report
Attention: 73 lines
in your changes are missing coverage. Please review.
Comparison is base (
e55d27d
) 69.86% compared to head (6e09889
) 67.20%. Report is 35 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #458 +/- ##
============================================
- Coverage 69.86% 67.20% -2.66%
- Complexity 110 155 +45
============================================
Files 26 38 +12
Lines 521 677 +156
============================================
+ Hits 364 455 +91
- Misses 157 222 +65
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Apologies for the delay, @HypeMC, I'm taking a look at this now!
@localheinz No problem, I can rebase if needed since there are conflicts, but I don't wanna do it while you're reviewing.