Skip to content

Conversation

@ilammy
Copy link
Contributor

@ilammy ilammy commented Nov 29, 2025

write_message() expects messages to contain no newlines.

Fixes #149436

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@chenyukang
Copy link
Member

chenyukang commented Nov 29, 2025

emm, seems there is no unit tests for all the formatters (not the issue for this PR).

@Mark-Simulacrum
Copy link
Member

There are some tests in tests/run-make/libtest-junit, can you update that to make sure this stays fixed?

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 4, 2025
Expect the entire input to be a single XML document, instead of
reading it line by line. This detects trailing junk better.
Copied validate_junit.py from libtest-junit.

JUnit format works well in edition 2021, but is currently broken
in edition 2024 by the mergeable doctest report.
Fix the panic in write_message() which expects messages to contain
no embedded newlines. We still want a trailing newline at the end
of the file though, so write it in different manner.

Doctest runner no longer panics, but the output is kinda broken
when `compile_fail` doctests are present. This is because they
are not mergeable.
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Dec 13, 2025
@ilammy
Copy link
Contributor Author

ilammy commented Dec 13, 2025

Added some tests to show how it works in edition 2021, fails in edition 2024, and how it's fixed by this PR.

However, while doing that I found a case that breaks JUnit output in edition 2024. Mergeable doctests will need a bit more work to fix that (should I file a separate issue for this?), but otherwise --format=junit is at least usable in some cases now.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 13, 2025
@ilammy ilammy changed the title Remove unnecessary newline in JUnit formatter Fix trailing newline in JUnit formatter Dec 13, 2025
@Mark-Simulacrum
Copy link
Member

Feel free to cut a separate issue. @bors r+

@bors
Copy link
Collaborator

bors commented Dec 13, 2025

📌 Commit 069cf9d has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 13, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Dec 14, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Dec 14, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
bors added a commit that referenced this pull request Dec 14, 2025
Rollup of 8 pull requests

Successful merges:

 - #148755 (Constify `DropGuard::dismiss` and trait impls)
 - #148825 (Add SystemTime::{MIN, MAX})
 - #149272 (Fix vec iter zst alignment)
 - #149417 (tidy: Detect outdated workspaces in workspace list)
 - #149437 (Fix trailing newline in JUnit formatter)
 - #149773 (fix va_list test by adding a llvmir signext check)
 - #149894 (Update to mdbook 0.5)
 - #149955 (Fix typo in armv7a-vex-v5 documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@ChrisDenton
Copy link
Member

Failed in #149975 (comment)

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctests: print_merged_doctests_times() crashes JUnit formatter

6 participants