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

kyua report-junit does not properly escape non-printable characters in <system-out> and <system-err> #136

Closed
rodrigc opened this issue Dec 6, 2014 · 3 comments

Comments

@rodrigc
Copy link
Contributor

rodrigc commented Dec 6, 2014

To reproduce:

(1) Create a Kyuafile:

syntax(2)

test_suite("test1")

plain_test_program{name="test1.sh"}

(2) Create test1.sh

#!/bin/sh
man ls

(3) Run the test, create JUnit test report:

kyua test
kyua report-junit --output=report.xml

(4) Import the report.xml into the Jenkins test report viewer.

The Jenkins test report viewer will give errors and refuse to import the test report.
The section in report.xml has non-printable ASCII characters which are invalid XML.
These characters need to be escaped.

The only non-printable ASCII characters which are OK in XML are carriage returns, line feeds,
spaces, and tabs. Everything else needs to be escaped. See: https://support.microsoft.com/kb/315580/en-us
for an example

I think the following function should be expanded to escape more characters:
https://github.com/jmmv/kyua/blob/master/utils/text/operations.cpp#L45

@jmmv
Copy link
Member

jmmv commented Dec 18, 2014

Cool. I didn't know which characters needed escaping, so the referenced code just did stuff on a trial and error basis. Will look.

@ngie-eign
Copy link
Contributor

Ping.

This issue is preventing me from writing test cases and integrating them in to FreeBSD. Example: https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests/1497/

@jmmv
Copy link
Member

jmmv commented Oct 18, 2015

I dropped the ball on this (and many other things lately). I have left some comments in the pull request.

I now have to figure out how to push a new release with this fix. I have been delaying it because HEAD is not fully functional; there is one little regression to be fixed in the TAP parser, but it is an annoying one to fix... I'll probably have to cherrypick a bunch of fixes and cut a micro-release instead of a full release from HEAD just so that this can be made available to you soon.

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

No branches or pull requests

3 participants