./mach test throws when running xpcshell tests: AttributeError: 'NoneType' object has no attribute 'startswith'

RESOLVED DUPLICATE of bug 1375173

Status

RESOLVED DUPLICATE of bug 1375173
a year ago
a year ago

People

(Reporter: mkelly, Unassigned)

Tracking

Version 3
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
If I try to run xpcshell tests using ./mach test, I get the following error:

$ ./mach test browser/extensions/shield-recipe-client/test/unit
Build configuration changed. Regenerating backend.
 0:00.28 LOG: MainThread WARNING MOZ_NODE_PATH environment variable not set. Tests requiring http/2 will fail.
Error running mach:

    ['test', 'browser/extensions/shield-recipe-client/test/unit']

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/mkelly/Projects/mozilla-unified/testing/mach_commands.py", line 343, in test
    test_objects=tests, **kwargs)
  File "/Users/mkelly/Projects/mozilla-unified/python/mach/mach/registrar.py", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "/Users/mkelly/Projects/mozilla-unified/python/mach/mach/registrar.py", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/mach_commands.py", line 269, in run_xpcshell_test
    return xpcshell.run_test(**params)
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/mach_commands.py", line 61, in run_test
    return self.run_suite(**kwargs)
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/mach_commands.py", line 47, in run_suite
    return self._run_xpcshell_harness(**kwargs)
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/mach_commands.py", line 137, in _run_xpcshell_harness
    result = xpcshell.runTests(**filtered_args)
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/runxpcshelltests.py", line 1274, in runTests
    self.buildTestList(test_tags, testPaths)
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/runxpcshelltests.py", line 874, in buildTestList
    self.alltests = map(normalize, mp.active_tests(filters=filters, **mozinfo.info))
  File "/Users/mkelly/Projects/mozilla-unified/testing/xpcshell/runxpcshelltests.py", line 837, in normalizeTest
    test_object['manifest'] = os.path.relpath(test_object['manifest'], root)
  File "/Users/mkelly/.virtualenvs/mozilla-unified/lib/python2.7/posixpath.py", line 430, in relpath
    start_list = [x for x in abspath(start).split(sep) if x]
  File "/Users/mkelly/.virtualenvs/mozilla-unified/lib/python2.7/posixpath.py", line 360, in abspath
    if not isabs(path):
  File "/Users/mkelly/.virtualenvs/mozilla-unified/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')

I tested this against both Shield's xpcshell tests, and netwerk/test/unit_ipc, both failed with the same error. Looks to have started after bug 1373796 landed. AFAICT the manifest generated when using ./mach test doesn't have a rootdir assigned, and so the second argument to relpath is None.
(Reporter)

Comment 1

a year ago
Oh yeah, ./mach xpcshell-test works fine, this only happens with ./mach test.
(Reporter)

Updated

a year ago
See Also: → bug 1373796
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1375173
You need to log in before you can comment on or make changes to this bug.