Skip to content

Libtest generated junit report includes extra newline at the start. #93454

Closed
@last-partizan

Description

@last-partizan

self.out.write_all(b"\n")?;

Hello, is there a reason to include this newline at the start?

@yaahc i'm tagging you, looks like it was your commit.

7779eb7

I'm trying to use junit format in github actions, and with this line, generated output could not be parsed by python junitparser. Sure it could be fixed there, but i don't think of any particular reason why this newline is needed.

cargo test -- -Z unstable-options --format junit > results.xml
...
2022-01-29 10:26:06 +0000 - publish-unit-test-results -  INFO - reading results.xml
2022-01-29 10:26:06 +0000 - publish - ERROR - Error processing result file: XML or text declaration not at start of entity: line 2, column 0

Also, those ending newlines isn't neccessary (but hopefully they aren't breaking anything).

Or maybe I doing something wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions