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

Special Characters in xUnit Report #175

Open
tmbrbr opened this issue Aug 9, 2023 · 0 comments
Open

Special Characters in xUnit Report #175

tmbrbr opened this issue Aug 9, 2023 · 0 comments
Assignees
Labels
bug Something isn't working upstream Issue related to upstream Firefox

Comments

@tmbrbr
Copy link
Contributor

tmbrbr commented Aug 9, 2023

When running the JavaScript test suite in the browser context jstestbrowser, it is possible to specify a flag to produce xUnit XML output, i.e.

./mach jstestbrowser --log-xunit=jsbrowsertest_output.xml --headless

However, some of the tests contain ASCII control characters in their names (generated automatically from the test content), for example, small-codepoints.js

var gTestfile = 'small-codepoints.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 554079;
var summary = 'JSON.parse should reject U+0000 through U+001F';

print(BUGNUMBER + ": " + summary);

/**************
 * BEGIN TEST *
 **************/

for (var i = 0; i <= 0x1F; i++)
  testJSON('["a' + String.fromCharCode(i) + 'c"]', true);

The code responsible for creating the xml is xunit.py which creates an XML tree, containing the control characters. Minidom is then used to parse the output, but throws a parser error when it finds the control chars.

I pushed a workaround (410b044) which removed control chars before passing to minidom, which seems to work.

This issue is open as a reminder to raise a bug report with firefox as it will also be present there.

@tmbrbr tmbrbr self-assigned this Aug 9, 2023
@tmbrbr tmbrbr added bug Something isn't working upstream Issue related to upstream Firefox labels Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Issue related to upstream Firefox
Projects
None yet
Development

No branches or pull requests

1 participant