SAP / SAP/project-foxhound

Special Characters in xUnit Report

Open
#175 0 comments 0 reactions 1 assignee View on GitHub

@tmbrbr is already working on this.

Since Aug 9, 2023.

bug upstream
Dominant language
JavaScript
Stars
178
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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 (410b04439631458795eb8e6df55249954785372a) 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.