web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
4.9k stars 3.06k forks source link

bug: `wpt run` does not work off-line for wdspec tests #41107

Open thiagowfx opened 1 year ago

thiagowfx commented 1 year ago

Discussion in #web-platform-tests (Matrix): https://matrix.to/#/!wKNaTuhRJSXtjUVpfk:matrix.org/$fZiFflhkB2WbFvaTnxV_5bPIkVxPLeMQccMl7_69Z4c?via=matrix.org&via=mozilla.org&via=igalia.com

It does not seem to be possible to run wpt run while completely off-line.

Whenever I don't have internet connection and try to do wpt run, it fails like this:

tperrotta@tperrotta-macbookpro ~/Projects/chromium-bidi (git)-[thiagowfx/serialization]
% ./runWPT.sh webdriver/tests/bidi/script/call_function/exception_details.py
(./runWPT.sh) Running WPT in headless mode...
(./runWPT.sh) Using pure mapper...
Running "webdriver/tests/bidi/script/call_function/exception_details.py" with "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"...
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x105237050>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/zstandard/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x105247910>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/zstandard/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x105250210>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/zstandard/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x105250b90>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/zstandard/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x105251550>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/zstandard/
ERROR: Could not find a version that satisfies the requirement zstandard==0.21.0 (from versions: none)
ERROR: No matching distribution found for zstandard==0.21.0
CRITICAL:tools.wpt.utils:('/Users/tperrotta/Projects/chromium-bidi/wpt/_venv3/bin/pip3', 'install', '--prefer-binary', '-r', '/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/../manifest/requirements.txt', '-r', '/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/../wptrunner/requirements.txt') exited with return code 1
CRITICAL:tools.wpt.utils:b''
Traceback (most recent call last):
  File "/Users/tperrotta/Projects/chromium-bidi/./wpt/wpt", line 10, in <module>
    wpt.main()
  File "/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/wpt.py", line 210, in main
    venv = setup_virtualenv(main_args.venv, main_args.skip_venv_setup, props)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/wpt.py", line 169, in setup_virtualenv
    venv.install_requirements(*props.get("requirements", []))
  File "/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/virtualenv.py", line 173, in install_requirements
    call(*cmd)
  File "/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/utils.py", line 27, in call
    return subprocess.check_output(args).decode('utf8')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('/Users/tperrotta/Projects/chromium-bidi/wpt/_venv3/bin/pip3', 'install', '--prefer-binary', '-r', '/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/../manifest/requirements.txt', '-r', '/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/../wptrunner/requirements.txt')' returned non-zero exit status 1.

It seems the culprit is pip:

subprocess.CalledProcessError: Command '('/Users/tperrotta/Projects/chromium-bidi/wpt/_venv3/bin/pip3', 'install', '--prefer-binary', '-r', '/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/../manifest/requirements.txt', '-r', '/Users/tperrotta/Projects/chromium-bidi/wpt/tools/wpt/../wptrunner/requirements.txt')' returned non-zero exit status 1. -> ERROR: Could not find a version that satisfies the requirement zstandard==0.21.0 (from versions: none)

This happens even for subsequent runs.

One would expect that the first run would install all dependencies, then subsequent runs would need no internet.

thiagowfx commented 1 year ago

How to reproduce: runWPT.sh does nothing special, it is merely a wrapper for wpt run.

Just do wpt run while off-line with any wdspec target, such as webdriver/tests/bidi/script/call_function/exception_details.py.