Repository navigation
feat: summarize integration test results and upload the reports - #401
Open
DavidLambauer wants to merge 3 commits into
Open
DavidLambauer wants to merge 3 commits into
DavidLambauer wants to merge 3 commits into
Conversation
…logs The action writes a job summary with the failed tests of each suite and annotates the first failures. It reads the TeamCity log because PHPUnit writes it while the tests run, so it also covers runs that PHPUnit aborted, which never get a JUnit log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… upload reports - Stream each module's PHPUnit output while it runs. Nx printed it only after the module finished, so a cancelled or timed-out job showed nothing. - Write a TeamCity log per module and summarize it with phpunit-report. - Upload the JUnit and TeamCity logs as an artifact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rhoerr
reviewed
Dec 1, 2026
rhoerr
left a comment
Member
There was a problem hiding this comment.
Nice improvement. Three things to look at:
- An empty TeamCity log is reported as passed. If PHPUnit opens the log but dies before the first suite starts (e.g. a data provider or test loading error),
parse()returnsplanned=None, no failures andended_early=False. The summary then shows:white_check_mark: passedwith?tests. Suggest treatingplanned is Noneas ended early or unknown, with an empty-log fixture test. - The summary can exceed GitHub's 1 MiB limit and be dropped. A broad change (e.g. Framework) runs many modules in one job. At up to 100 rows of about 450 bytes per failing suite, roughly 23 failing suites pass the limit, and GitHub then drops the whole summary. Suggest a global row cap (about 300–500) or a byte budget in
markdown(), pointing to the artifact for the rest. - Minor: a bootstrap failure reads as "no suite ran". If PHPUnit's bootstrap fails (e.g. the Magento install), no log is created, so that module is left out, or the summary says "no suite ran". Something like "No TeamCity logs found, see the job log" would be more accurate.
…ary below 1 MiB - An empty TeamCity log is shown as without results instead of passed. PHPUnit leaves the log empty both when no test matched and when it stopped while loading the tests, so it can't be read as ended early. - The failure rows stop at 512 KiB, because GitHub drops a step summary larger than 1 MiB. The summary then points to the new reports-url input, which the Nx integration workflow sets to the uploaded reports. - Without any log, the summary says to see the job log instead of claiming that no suite ran: PHPUnit writes no log when its bootstrap fails.
Contributor
Author
|
@rhoerr thanks, all three are fixed in 661cd3b:
I also ran the Nx workflow end to end from my forks with a failing test in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Nx integration job only shows test results in the raw job log, and often not even there:
What
phpunit-reportis a new composite action that uses only the Python 3 standard library.--output-style=stream-without-prefixes; the Nx 15.4.1 pinned by nx-for-php supports it).phpunit-report.phpunit-output/(JUnit and TeamCity) asintegration-test-reports-<job-index>, kept for 14 days._internal-phpunit-report.yamlruns the script's unit tests and runs the action on the fixture logs.Testing
python3 -m unittest discover -s phpunit-report/test: 13 tests, passing.Magento_Version: run 46139702565.junit/Version.xmlandteamcity/Version.log.Job summary of that run
Integration tests
❌ 1 of 1 suite failed: 3 failed tests.
Version: 3 failed tests
Magento\Version\Test\Integration\ReportDemoTest::testFailsAnAssertionMagento\Version\Test\Integration\ReportDemoTest::testThrowsMagento\Version\Test\Integration\ReportDemoTest::testDataSet with data set "large"Notes
mage-os/github-actions/phpunit-report@main, like the other actions, so the summary step works once this PR is merged.🤖 Generated with Claude Code