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

Cannot use `mach test` to run xpcshell tests

RESOLVED FIXED in Firefox 56

Status

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: bsilverberg, Assigned: ahal)

Tracking

Version 3
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

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
message.

The details of the failure are as follows:

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

  File "/Users/bsilverberg/mozilla-central/testing/mach_commands.py", line 343, in test
    test_objects=tests, **kwargs)
  File "/Users/bsilverberg/mozilla-central/python/mach/mach/registrar.py", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "/Users/bsilverberg/mozilla-central/python/mach/mach/registrar.py", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/mach_commands.py", line 269, in run_xpcshell_test
    return xpcshell.run_test(**params)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/mach_commands.py", line 61, in run_test
    return self.run_suite(**kwargs)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/mach_commands.py", line 47, in run_suite
    return self._run_xpcshell_harness(**kwargs)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/mach_commands.py", line 137, in _run_xpcshell_harness
    result = xpcshell.runTests(**filtered_args)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/runxpcshelltests.py", line 1274, in runTests
    self.buildTestList(test_tags, testPaths)
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/runxpcshelltests.py", line 874, in buildTestList
    self.alltests = map(normalize, mp.active_tests(filters=filters, **mozinfo.info))
  File "/Users/bsilverberg/mozilla-central/testing/xpcshell/runxpcshelltests.py", 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/posixpath.py", 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/posixpath.py", 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/posixpath.py", 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)
(Assignee)

Updated

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

Comment 7

a year ago
mozreview-review
Comment on attachment 8880792 [details]
Bug 1375173 - Fix bug preventing running xpcshell from ./mach test,

https://reviewboard.mozilla.org/r/152168/#review157250
Attachment #8880792 - Flags: review?(james) → review+

Comment 8

a year ago
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a0f804d0b487
Fix bug preventing running xpcshell from ./mach test, r=jgraham

Comment 9

a year ago
Backout by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/89d904147926
Backed out changeset a0f804d0b487 for failing Windows taskcluster builds in selftest.py | XPCShellTestsTests.testAddTaskRunNextTest. r=backout on a CLOSED TREE
Duplicate of this bug: 1376965
Comment hidden (mozreview-request)

Comment 13

a year ago
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/28cd0318986f
Fix bug preventing running xpcshell from ./mach test, r=jgraham

Comment 14

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/28cd0318986f
Status: ASSIGNED → RESOLVED
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.