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

Goss doesn't escape output in generated JUnit XML #203

Closed
AlexandreCarlton opened this issue Mar 11, 2017 · 1 comment
Closed

Goss doesn't escape output in generated JUnit XML #203

AlexandreCarlton opened this issue Mar 11, 2017 · 1 comment

Comments

@AlexandreCarlton
Copy link
Contributor

When generating JUnit XML, Goss does not escape special characters which can result in malformed XML.

As an arbitrary example:

command:
  echo 'foo' > /dev/null:
    exit-status: 0

The resulting XML is:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="goss" errors="0" tests="1" failures="0" skipped="0" time="0.002" timestamp="2017-03-11T06:52:24Z">
<testcase name="Command echo 'foo' > /dev/null exit-status" time="0.002">
<system-out>Command: echo 'foo' > /dev/null: exit-status: matches expectation: [0]</system-out>
</testcase>
</testsuite>

Notably, the > and ' characters are not escaped in both the text of system-out and the name attribute of testcase. It would be really great if that could be fixed. :)

AlexandreCarlton added a commit to AlexandreCarlton/goss that referenced this issue Mar 11, 2017
Previously, characters such as '>' in tests were not escaped in the
generated JUnit XML output (resulting in malformed output).

Now, such characters are escaped.

References goss-org#203
@LudwigHoff
Copy link

+1

AlexandreCarlton added a commit to AlexandreCarlton/goss that referenced this issue Apr 22, 2017
Colour output is currently interfering with the XML escaping, so we
remove it.

References goss-org#203
aelsabbahy pushed a commit that referenced this issue Apr 23, 2017
* Escape special characters in JUnit XML output

Previously, characters such as '>' in tests were not escaped in the
generated JUnit XML output (resulting in malformed output).

Now, such characters are escaped.

References #203

* Disable colour in JUnit output

Colour output is currently interfering with the XML escaping, so we
remove it.

References #203
BenjaminHerbert pushed a commit to BenjaminHerbert/goss that referenced this issue May 28, 2020
* Escape special characters in JUnit XML output

Previously, characters such as '>' in tests were not escaped in the
generated JUnit XML output (resulting in malformed output).

Now, such characters are escaped.

References goss-org#203

* Disable colour in JUnit output

Colour output is currently interfering with the XML escaping, so we
remove it.

References goss-org#203
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