Closed Bug 1124192 Opened 7 years ago Closed 7 years ago

Web Platform Tests do not run on Windows via mach

Categories

(Firefox Build System :: General, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla38

People

(Reporter: cmtalbert, Assigned: ted)

Details

Attachments

(1 file)

Running the web platform tests with mach doesn't work on my windows machine:
mozilla@CTALBERT-19285 ~/projects/m-c
$ ./mach web-platform-tests --test-type=testharness --include=dom
 0:00.20 LOG: MainThread INFO Closing logging queue
Error running mach:

    ['web-platform-tests', '--test-type=testharness', '--include=dom']

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:

TypeError: environment can only contain strings

  File "c:\Users\mozilla\projects\m-c\testing/web-platform/mach_commands.py", line 132, in run_
web_platform_tests
    return wpt_runner.run_tests(**params)
  File "c:\Users\mozilla\projects\m-c\testing/web-platform/mach_commands.py", line 73, in run_t
ests
    result = wptrunner.run_tests(**kwargs)
  File "c:\Users\mozilla\projects\m-c\testing/web-platform/harness\wptrunner\wptrunner.py", lin
e 371, in run_tests
    run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=False)
  File "c:\Users\mozilla\projects\m-c\testing/web-platform/harness\wptrunner\wpttest.py", line
51, in get_run_info
    return RunInfo(metadata_root, product, **kwargs)
  File "c:\Users\mozilla\projects\m-c\testing/web-platform/harness\wptrunner\wpttest.py", line
56, in __init__
    self._update_mozinfo(metadata_root)
  File "c:\Users\mozilla\projects\m-c\testing/web-platform/harness\wptrunner\wpttest.py", line
73, in _update_mozinfo
    mozinfo.find_and_update_from_json(*dirs)
  File "c:\Users\mozilla\projects\m-c\testing/mozbase/mozinfo\mozinfo\mozinfo.py", line 164, in
 find_and_update_from_json
    build = MozbuildObject.from_environment()
  File "c:\Users\mozilla\projects\m-c\python/mozbuild\mozbuild\base.py", line 165, in from_envi
ronment
    config = loader.read_mozconfig(mozconfig, moz_build_app=current_project)
  File "c:\Users\mozilla\projects\m-c\python/mozbuild\mozbuild\mozconfig.py", line 224, in read
_mozconfig
    cwd=self.topsrcdir, env=env)
  File "c:\mozilla-build\python\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "c:\mozilla-build\python\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\mozilla-build\python\lib\subprocess.py", line 958, in _execute_child
    startupinfo)

I have a checkout from yesterday my hg tip is:
mozilla@CTALBERT-19285 ~/projects/m-c
$ hg tip
←[0;33mchangeset:   224632:c2df1daf74c3←[0m
tag:         tip
parent:      224627:3803a1420b1d
parent:      224631:aae834627534
user:        Carsten "Tomcat" Book <cbook@mozilla.com>
date:        Tue Jan 20 12:19:59 2015 +0100
summary:     merge fx-team to mozilla-central a=merge

I successfully clobbered and built just prior to attempting running them using this changeset.

Here is my mozconfig:
mozilla@CTALBERT-19285 ~/projects/m-c
$ cat .mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-dbg-win32

ac_add_options --enable-debug
ac_add_options --enable-signmar
#ac_add_options --disenable-require-all-d3dc-versions
ac_add_options --enable-winsdk-directx

Other mach commands like: ./mach mochitest-plain work properly.

James, this is the bug I threatened to file yesterday. Just got to it today. Let me know if you need any other info here (needinfo me).
Flags: needinfo?(james)
Component: web-platform-tests → Build Config
Product: Testing → Core
I think wpt is just unlucky here being the only thing that uses activate_virtualenv and also calling something that uses subprocess directly instead of run_process, which already has a workaround for this:
https://dxr.mozilla.org/mozilla-central/source/python/mach/mach/mixin/process.py#104

The root problem here is that virtualenv.py uses unicode_literals, but then calls execfile on activate_this.py which sticks string literals into os.environ['PATH'], so they wind up as unicode.

This patch makes me able to run wpt locally via mach on Windows.
Assignee: nobody → ted
Status: NEW → ASSIGNED
Attachment #8554573 - Flags: review?(gps)
Flags: needinfo?(james)
Attachment #8554573 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/8c25582fc776
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.