Closed Bug 1163037 Opened 9 years ago Closed 9 years ago

AttributeError: 'Namespace' object has no attribute 'closeWhenDone' | when running mochitest with ./mach test

Categories

(Testing :: General, defect)

defect
Not set
major

Tracking

(firefox40 affected)

RESOLVED FIXED
Tracking Status
firefox40 --- affected

People

(Reporter: ehsan.akhgari, Assigned: ahal)

References

Details

(Whiteboard: [workaround in comment 2])

$ ./mach test browser/devtools/framework/test/browser_toolbox_textbox_context_menu.js
From _tests: Kept 35898 existing; Added/updated 0; Removed 0 files and 0 directories.
Error running mach:

    ['test', 'browser/devtools/framework/test/browser_toolbox_textbox_context_menu.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: 'Namespace' object has no attribute 'closeWhenDone'

  File "/Users/ehsan/moz/src/testing/mach_commands.py", line 247, in test
    test_objects=tests, **kwargs)
  File "/Users/ehsan/moz/src/python/mach/mach/registrar.py", line 62, in dispatch
    return fn(**args) or 0
  File "/Users/ehsan/moz/src/testing/mochitest/mach_commands.py", line 556, in run_mochitest_general
    **kwargs)
  File "/Users/ehsan/moz/src/testing/mochitest/mach_commands.py", line 300, in run_desktop_test
    if len(tests) == 1 and options.closeWhenDone and suite == 'plain':
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
The |mach test| command isn't instantiating a MochitestArgumentParser so none of the default options are getting set. We'll need to instantiate it some other way. Sorry about that, in the meantime please use:

./mach mochitest-devtools browser/devtools/framework/test/browser_toolbox_textbox_context_menu.js
Depends on: 1155338
Summary: The recent closeWhenDone changes have broken ./mach test for running devtools tests → |mach test| doesn't instantiate a MochitestArgumentParser when running mochitests
Depends on: 1163112
I tracked this down to a bug in mach core (bug 1163112). I'm not 100% sure yet how to fix it, so in the meantime I'm changing the title of this one to make it easier for other people experiencing the same problem to find.

For anyone hitting this, the workaround is to use the mochitest specific mach commands instead of |mach test|. E.g:

./mach mochitest path/to/test

or

./mach mochitest -f browser-chrome
Summary: |mach test| doesn't instantiate a MochitestArgumentParser when running mochitests → AttributeError: 'Namespace' object has no attribute '<foo>' | when running mochitest with ./mach test
(In reply to Andrew Halberstadt [:ahal] from comment #2)
> I tracked this down to a bug in mach core (bug 1163112). I'm not 100% sure
> yet how to fix it, so in the meantime I'm changing the title of this one to
> make it easier for other people experiencing the same problem to find.
> 
> For anyone hitting this, the workaround is to use the mochitest specific
> mach commands instead of |mach test|. E.g:
> 
> ./mach mochitest path/to/test
> 
> or
> 
> ./mach mochitest -f browser-chrome

To add to this: except for mochitest-devtools, which cannot be run with ./mach mochitest because of bug 1122590!
Found this bug from the blame of bug 1155338 after a failed search in Bugzilla for "closeWhenDone", so I'm adding the keyword to the summary for reference.
Severity: normal → major
Summary: AttributeError: 'Namespace' object has no attribute '<foo>' | when running mochitest with ./mach test → AttributeError: 'Namespace' object has no attribute 'closeWhenDone' | when running mochitest with ./mach test
Whiteboard: [workaround in comment 2]
This should be fixed on inbound, will close once bug 1163112 is merged in.
Please let me know if anything isn't working as expected.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.