Closed Bug 1370936 Opened 7 years ago Closed 7 years ago

unable to run mach wpt-update locally due to import error for 'update'

Categories

(Testing :: web-platform-tests, defect)

defect
Not set
normal

Tracking

(firefox56 fixed)

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: jmaher, Assigned: jgraham)

References

Details

Attachments

(6 files)

elvis@JMAHER-WIN10 ~/mozilla-inbound
$ ./mach wpt-update testing/web-platform/update/logs
Error running mach:

    ['wpt-update', 'testing/web-platform/update/logs']

The error occurred in mach itself. This is likely a bug in mach itself or a
fundamental problem with a loaded module.

Please consider filing a bug against mach by going to the URL:

    https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=mach


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 update

  File "c:\Users\elvis\mozilla-inbound\python/mach\mach\main.py", line 352, in run
    return self._run(argv)
  File "c:\Users\elvis\mozilla-inbound\python/mach\mach\main.py", line 407, in _run
    args = parser.parse_args(argv)
  File "c:\mozilla-build\python\lib\argparse.py", line 1701, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "c:\mozilla-build\python\lib\argparse.py", line 1733, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "c:\mozilla-build\python\lib\argparse.py", line 1942, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "c:\mozilla-build\python\lib\argparse.py", line 1898, in consume_positionals
    take_action(action, args)
  File "c:\mozilla-build\python\lib\argparse.py", line 1807, in take_action
    action(self, namespace, argument_values, option_string)
  File "c:\Users\elvis\mozilla-inbound\python/mach\mach\dispatcher.py", line 173, in __call__
    if handler.parser:
  File "c:\Users\elvis\mozilla-inbound\python/mach\mach\decorators.py", line 77, in parser
    self._parser = self._parser()
  File "c:\Users\elvis\mozilla-inbound\testing/web-platform/mach_commands.py", line 312, in create_parser_update
    from update import updatecommandline
  File "c:\Users\elvis\mozilla-inbound\build/mach_bootstrap.py", line 327, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "c:\Users\elvis\mozilla-inbound\testing/web-platform\update\__init__.py", line 17, in <module>
    from wptrunner.update import setup_logging, WPTUpdate
  File "c:\Users\elvis\mozilla-inbound\build/mach_bootstrap.py", line 327, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)

elvis@JMAHER-WIN10 ~/mozilla-inbound
$



I should get a bug on file, this is with mozilla-build on windows 10.  I have verified it fails with bash on windows 10 as well- so it is either something odd in my configuration, or something specific to windows 10.  IIRC :jgraham has verified this works for windows10
it appears we have to insert a proper path, by changing (testing\web-platform\update\__init__.py):
sys.path.insert(0, os.path.abspath(os.path.join(here, os.pardir, "harness")))

to:
sys.path.insert(0, os.path.abspath(os.path.join(here, os.pardir, "tests", "tools", "wptrunner")))


I will get a patch up shortly
:jgraham, this set of hacks are what I did to get to the 'hg qfinish' failure, possibly you know if some of these are needed, or need to be smarter based on os flavor.
Flags: needinfo?(james)
Component: mach → web-platform-tests
Product: Core → Testing
Comment on attachment 8878421 [details]
Bug 1370936 - Update the module path for wpt update,

https://reviewboard.mozilla.org/r/149766/#review154424
Attachment #8878421 - Flags: review?(ato) → review+
Comment on attachment 8878422 [details]
Bug 1370936 - Ensure manifest directory exists before writing it,

https://reviewboard.mozilla.org/r/149768/#review154426
Attachment #8878422 - Flags: review?(ato) → review+
Comment on attachment 8878423 [details]
Bug 1370936 - Use platform agnostic check for an absolute path,

https://reviewboard.mozilla.org/r/149770/#review154428
Attachment #8878423 - Flags: review?(ato) → review+
Comment on attachment 8878424 [details]
Bug 1370936 - Default to not creating a commit when updating wpt metadata,

https://reviewboard.mozilla.org/r/149772/#review154430
Attachment #8878424 - Flags: review?(ato) → review+
Comment on attachment 8878425 [details]
Bug 1370936 - Skip directories when updating metdata,

https://reviewboard.mozilla.org/r/149774/#review154434

Looks fine, but I didn’t check wptcommandline.check_args_update vs. set_from_config in detail.

::: testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py:402
(Diff revision 1)
>      if kwargs["patch"] is None:
>          kwargs["patch"] = kwargs["sync"]
>  
> +    for item in kwargs["run_log"]:
> +        if os.path.isdir(item):
> +            print >> sys.stderr, "Log file %s is a directory" % item

This is a minor thing, but I think you should either start this with "error:" or say what the expectation is ("Expected log file, but %s is a directory") so that the program doesn’t just exit without an explanation.
Attachment #8878425 - Flags: review?(ato) → review+
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/bd5282baa7b5
Update the module path for wpt update, r=ato
https://hg.mozilla.org/integration/autoland/rev/92407ad11b3d
Ensure manifest directory exists before writing it, r=ato
https://hg.mozilla.org/integration/autoland/rev/a789a5ea61c4
Use platform agnostic check for an absolute path, r=ato
https://hg.mozilla.org/integration/autoland/rev/7ea0c89dd276
Default to not creating a commit when updating wpt metadata, r=ato
https://hg.mozilla.org/integration/autoland/rev/ab25ab9177ec
Skip directories when updating metdata, r=ato
Flags: needinfo?(james)
Assignee: nobody → james
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: