./mach mochitest-plain ImportError: No module named automation

RESOLVED INVALID

Status

RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: daleharvey, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Comment hidden (empty)
(Reporter)

Comment 1

5 years ago
$ MOZCONFIG=~/src/dotfiles/moz/firefox.debug.mozconfig ./mach build

.... lots of stuff, successful build

$ ./mach mochitest-plain layout/base/tests/border_radius_hit_testing_iframe.html
Error running mach:

    ['mochitest-plain', 'layout/base/tests/border_radius_hit_testing_iframe.html']

The error occurred in the implementation of the invoked mach command.

This should never occur and is likely a bug in the implementation of that
command. 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:

ImportError: No module named automation

  File "/Users/daleharvey/src/moz/mozilla-central-git/testing/mochitest/mach_commands.py", line 380, in run_mochitest_plain
    return self.run_mochitest(test_file, 'plain', **kwargs)
  File "/Users/daleharvey/src/moz/mozilla-central-git/testing/mochitest/mach_commands.py", line 423, in run_mochitest
    **kwargs)
  File "/Users/daleharvey/src/moz/mozilla-central-git/testing/mochitest/mach_commands.py", line 137, in run_desktop_test
    from automation import Automation
(Reporter)

Comment 2

5 years ago
My mozconfig for reference

mk_add_options MOZ_OBJDIR=$HOME/src/moz/objdir/firefox-debug
mk_add_options MOZ_MAKE_FLAGS="-j6 -s"
mk_add_options AUTOCLOBBER=1
ac_add_options --enable-debug

ac_add_options --enable-application=browser

ac_add_options --enable-tests
ac_add_options --with-ccache

export ENABLE_MARIONETTE=1
export MOZ_PACKAGE_JSSHELL=1
export MOZ_TELEMETRY_REPORTING=1
(Reporter)

Comment 3

5 years ago
If I try running without mach I get

$ TEST_PATH=layout/base/tests/border_radius_hit_testing_iframe.html make -C ../objdir/firefox-debug/ mochitest-plain
rm -f ./mochitest-plain.log && /Users/daleharvey/src/moz/objdir/firefox-debug/_virtualenv/bin/python _tests/testing/mochitest/runtests.py --autorun --close-when-done --console-level=INFO --log-file=./mochitest-plain.log --file-level=INFO --failure-file=/Users/daleharvey/src/moz/objdir/firefox-debug/_tests/testing/mochitest/makefailures.json --testing-modules-dir=/Users/daleharvey/src/moz/objdir/firefox-debug/_tests/modules --extra-profile-file=./dist/plugins --symbols-path=./dist/crashreporter-symbols --test-path="layout/base/tests/border_radius_hit_testing_iframe.html"
Traceback (most recent call last):
  File "_tests/testing/mochitest/runtests.py", line 23, in <module>
    from automation import Automation
  File "/Users/daleharvey/src/moz/objdir/firefox-debug/_tests/testing/mochitest/automation.py", line 34, in <module>
    from mozprofile import Profile, Preferences
ImportError: cannot import name Preferences
make: *** [mochitest-plain] Error 1

Comment 4

5 years ago
I bet if you run mach from the objdir without the MOZCONFIG environment variable set, it will just work.

Can you also paste the output of |mach environment| where you can repro this. If you are setting MOZCONFIG, please set that variable when running |mach environment|.
Flags: needinfo?(dale)

Updated

5 years ago
Blocks: 912114
(Reporter)

Comment 5

5 years ago
Ugh, this is my bad, I forgot to specify mozconfig when running mochitest-plain, annoying thing is I am fairly sure I have done this before, apologies
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: needinfo?(dale)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.