Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verifier CLI: junit output contains invalid characters. #421

Closed
mjpieters opened this issue May 16, 2024 · 1 comment · Fixed by #426
Closed

Verifier CLI: junit output contains invalid characters. #421

mjpieters opened this issue May 16, 2024 · 1 comment · Fixed by #426

Comments

@mjpieters
Copy link
Contributor

The JUnit output includes a <system-out> element with a CDATA child body, but the contents of the section contain invalid characters. Specifically the ANSI escape codes are included using (raw) #x1B bytes for the ESC character, but #x1B is not a codepoint that can be used in XML documents. This means the output isn't actually usable by XML parsers.

Perhaps the ANSI codes should just be stripped entirely?

@mjpieters
Copy link
Contributor Author

mjpieters commented May 22, 2024

There is a work-around: disable colours when you absolutely need the XML report:

$ pact_verifier_cli --no-colour --junit verifier-report.xml ...

I think this is actually a junit-report regression. Their Cargo.toml file has a dependency on the strip-ansi-escapes crate, but right after upgrading the version for that crate they committed a change that removed all use of it, which I think is accidental. Nope, sorry, that's just their tests.

You can trivially strip ansi escapes with the strip-ansi-escapes crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant