Fix JUnit HTML reports collapsing whitespace in failure messages#3732
Fix JUnit HTML reports collapsing whitespace in failure messages#3732
Conversation
|
@copilot how do I check if this PR does what it is supposed to do? |
To verify this PR locally:
Notice |
faeb12d to
be9ce23
Compare
fedejeanne
left a comment
There was a problem hiding this comment.
Tested it locally, works as expected.
If there are no objections, I will merge this next week.
HannesWell
left a comment
There was a problem hiding this comment.
Tested it locally, works as expected.
How did you test it exactly?
Although it's not exactly related to this task, are you aware of the instructions how to test the build website locally?
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/tree/master/sites/eclipse
In this case it doesn't help since the test-data download script doesn't download test results.
ed8fe9a to
680f096
Compare
- Add `white-space: pre-wrap` CSS rule for `code` elements so spaces and newlines are preserved in browser rendering - Wrap @message output in a `<code>` element so the failure message text also benefits from the whitespace preservation CSS rule Fixes: #3723 Agent-Logs-Url: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/sessions/70ecfbb4-6cee-4f8f-a49b-c8496722fff2 Co-authored-by: Federico Jeanne <Federico.Jeanne@vector.com>
680f096 to
3d79801
Compare
fedejeanne
left a comment
There was a problem hiding this comment.
How did you test it exactly?
@HannesWell I used a script generated by copilot in WSL. I put it in my own branch for you to test too, if you want:
|
@fedejeanne please keep in mind this when working with copilot on platform repos: https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#using-github-copilot-agent this prevents a lot of mail-traffic when some iterations are needed and you can later create a PR against the base easily instead of having the branches live in the main repository. |


Browsers collapse consecutive whitespace by default, making failure messages with significant spacing (e.g.
String s = (String)o;→String s = (String)o;) unreadable in generated JUnit HTML reports.Changes
JUNIT.XSLcode { white-space: pre-wrap; }CSS rule to preserve spaces and newlines inside<code>blocks@messageoutput in<code>so the failure message inherits the same ruleverify/— self-contained verification helper (no build required)sample-results.xml: JUnit XML with intentional whitespace in failure messagesverify.sh: transforms the sample XML withJUNIT.XSLand opens the result in a browser; supports WSL (explorer.exe), macOS (open), and Linux (xdg-open); requiresxsltproc(sudo apt-get install xsltproc) orpython3+lxmlcd products/eclipse-junit-tests/src/main/scripts/verify ./verify.sh💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.