All users were logged out of Bugzilla on October 13th, 2018

Cannot use `mach test` to run xpcshell tests

RESOLVED FIXED in Firefox 56


a year ago
a year ago


(Reporter: bsilverberg, Assigned: ahal)


Version 3

Firefox Tracking Flags

(firefox56 fixed)



(1 attachment)



a year ago
When trying to run an xpcshell test via `mach test`, I see the following output:


 (convert.unique)mozilla-central$ ./mach test browser/components/extensions/test/xpcshell/test_ext_history.js
 0:00.28 LOG: MainThread WARNING MOZ_NODE_PATH environment variable not set. Tests requiring http/2 will fail.
Error running mach:

    ['test', 'browser/components/extensions/test/xpcshell/test_ext_history.js']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error

The details of the failure are as follows:

AttributeError: 'NoneType' object has no attribute 'startswith'

  File "/Users/bsilverberg/mozilla-central/testing/", line 343, in test
    test_objects=tests, **kwargs)
  File "/Users/bsilverberg/mozilla-central/python/mach/mach/", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "/Users/bsilverberg/mozilla-central/python/mach/mach/", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 269, in run_xpcshell_test
    return xpcshell.run_test(**params)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 61, in run_test
    return self.run_suite(**kwargs)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 47, in run_suite
    return self._run_xpcshell_harness(**kwargs)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 137, in _run_xpcshell_harness
    result = xpcshell.runTests(**filtered_args)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 1274, in runTests
    self.buildTestList(test_tags, testPaths)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 874, in buildTestList
    self.alltests = map(normalize, mp.active_tests(filters=filters, **
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/", line 837, in normalizeTest
    test_object['manifest'] = os.path.relpath(test_object['manifest'], root)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 430, in relpath
    start_list = [x for x in abspath(start).split(sep) if x]
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 360, in abspath
    if not isabs(path):
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 54, in isabs
    return s.startswith('/')


Note that running the same test via `mach xpcshell-test` works fine.
I have the same problem.
I wonder why this component has no Triage owner...
Flags: needinfo?(gps)
Duplicate of this bug: 1375633
mkelly suggested bug 1373796, maybe a regression from that change?
Blocks: 1373796
Yes, this is a regression from de305ad8a8ee.

ahal: can you please investigate?
Flags: needinfo?(gps) → needinfo?(ahalberstadt)


a year ago
Assignee: nobody → ahalberstadt
Flags: needinfo?(ahalberstadt)
Comment hidden (mozreview-request)

Comment 7

a year ago
Comment on attachment 8880792 [details]
Bug 1375173 - Fix bug preventing running xpcshell from ./mach test,
Attachment #8880792 - Flags: review?(james) → review+

Comment 8

a year ago
Pushed by
Fix bug preventing running xpcshell from ./mach test, r=jgraham

Comment 9

a year ago
Backout by
Backed out changeset a0f804d0b487 for failing Windows taskcluster builds in | XPCShellTestsTests.testAddTaskRunNextTest. r=backout on a CLOSED TREE
Duplicate of this bug: 1376965
Comment hidden (mozreview-request)

Comment 13

a year ago
Pushed by
Fix bug preventing running xpcshell from ./mach test, r=jgraham

Comment 14

a year ago
Last Resolved: a year ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.