The default bug view has changed. See this FAQ.

XML report generation fails when any tests are skipped

RESOLVED FIXED in Firefox 18

Status

Testing
Marionette
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: davehunt, Assigned: davehunt)

Tracking

unspecified
mozilla19
Points:
---

Firefox Tracking Flags

(firefox18 fixed, firefox19 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
If a test is skipped and you have provided the command line option to save an XML report, an exception is thrown:

$ gaiatest --address=localhost:2828 --type=b2g --xml-output=results.xml gaiatest/tests/test_browser.py
starting httpd
running webserver on http://192.168.252.204:43211/
TEST-START test_browser.py
test_browser_basic (test_browser.TestBrowser) ... skipped "Don't want to run this on CI"

----------------------------------------------------------------------
Ran 1 test in 0.000s

OK (skipped=1)

SUMMARY
-------
passed: 0
failed: 0
todo: 1
Traceback (most recent call last):
  File "/home/mozilla/.virtualenvs/Gaia/bin/gaiatest", line 8, in <module>
    load_entry_point('gaiatest==0.2', 'console_scripts', 'gaiatest')()
  File "/home/mozilla/gaia-ui-tests/gaiatest/runtests.py", line 17, in main
    cli(runner_class=GaiaTestRunner)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 718, in cli
    runner = startTestRunner(runner_class, options, tests)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 713, in startTestRunner
    runner.run_tests(tests, testtype=options.type)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 374, in run_tests
    f.write(self.generate_xml(self.results))
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 564, in generate_xml
    _extract_xml(*tup, result='Skip')
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 520, in _extract_xml
    t.appendChild(f)
UnboundLocalError: local variable 'f' referenced before assignment
(Assignee)

Comment 1

4 years ago
Created attachment 681072 [details] [diff] [review]
Fix report when tests are skipped using unittest.skip

This patch fixes the issue for tests skipped using unittest.skip, however there appears to still be an issue when tests are skipped via a manifest.
Attachment #681072 - Flags: review?(jgriffin)
Comment on attachment 681072 [details] [diff] [review]
Fix report when tests are skipped using unittest.skip

Review of attachment 681072 [details] [diff] [review]:
-----------------------------------------------------------------

Good catch!
Attachment #681072 - Flags: review?(jgriffin) → review+
Assignee: nobody → dhunt
https://hg.mozilla.org/integration/mozilla-inbound/rev/baba249d52f8
https://hg.mozilla.org/releases/mozilla-aurora/rev/da9e6a7f7ac7
status-firefox18: --- → fixed
status-firefox19: --- → fixed
https://hg.mozilla.org/mozilla-central/rev/baba249d52f8
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.