Closed Bug 1141720 Opened 6 years ago Closed 6 years ago

run-tests.py can not output xunit format xml if a test with unicode in it fails

Categories

(MozReview Graveyard :: General, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dminor, Unassigned)

Details

If a test with unicode in it fails (e.g. hgext/reviewboard/tests/test_unicode.t) run-tests.py will throw an exception when trying to write xunit xml:

Traceback (most recent call last):
  File "./run-mercurial-tests.py", line 322, in <module>
    res = runner.run(sys.argv[1:])
  File "/home/dminor/src/version-control-tools/pylib/mercurial-support/run-tests.py", line 1572, in run
    return self._run(tests)
  File "/home/dminor/src/version-control-tools/pylib/mercurial-support/run-tests.py", line 1679, in _run
    return self._runtests(tests) or 0
  File "/home/dminor/src/version-control-tools/pylib/mercurial-support/run-tests.py", line 1738, in _runtests
    result = runner.run(suite)
  File "/home/dminor/src/version-control-tools/pylib/mercurial-support/run-tests.py", line 1461, in run
    xuf.write(doc.toprettyxml(indent='  ', encoding='utf-8'))
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 58, in toprettyxml
    self.writexml(writer, "", indent, newl, encoding)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1749, in writexml
    node.writexml(writer, indent, addindent, newl)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 814, in writexml
    node.writexml(writer, indent+addindent, addindent, newl)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 814, in writexml
    node.writexml(writer, indent+addindent, addindent, newl)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1151, in writexml
    writer.write("<![CDATA[%s]]>" % self.data)
  File "/home/dminor/src/version-control-tools/venv/lib/python2.7/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 4658: ordinal not in range(128)
Priority: P2 → P3
We have too many P1s, so I'm spreading out the priorities.  P3 -> P4, P2 -> P3, and some portion of P1s will become P2.
Priority: P3 → P4
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.