diff --git a/.github/workflows/devtools.yml b/.github/workflows/devtools.yml index 73739fa17ab3..eaff36dffb47 100644 --- a/.github/workflows/devtools.yml +++ b/.github/workflows/devtools.yml @@ -105,7 +105,7 @@ jobs: run: bash $GITHUB_WORKSPACE/lighthouse/lighthouse-core/test/chromium-web-tests/download-content-shell.sh - name: Install python deps - run: pip install six requests + run: python3 -m pip install six requests - name: Run Web Tests run: bash $GITHUB_WORKSPACE/lighthouse/lighthouse-core/test/chromium-web-tests/run-web-tests.sh diff --git a/lighthouse-core/test/chromium-web-tests/README.md b/lighthouse-core/test/chromium-web-tests/README.md index 6b83e5b564db..a131bcd86e82 100644 --- a/lighthouse-core/test/chromium-web-tests/README.md +++ b/lighthouse-core/test/chromium-web-tests/README.md @@ -21,15 +21,12 @@ SKIP_DOWNLOADS=1 yarn test-devtools ### Prerequistes
- Install `requests` - - Ensure you have `requests` module available globally on your python 2.7 install. New Macs do not come with pip for python 2.7 which is deprecated, so you might have to install that too. + Install python dependencies + Ensure you have these modules available globally on your python 3.x install: ```sh - curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py - python get-pip.py - pip -m pip install requests + python3 -m pip install requests six ```
@@ -108,7 +105,7 @@ yarn run-devtools http://example.com #### How to modify blink-tools.patch? -Simply make your changes in `.tmp/chromium-web-tests/blink_tools`, and run: `git -C .tmp/chromium-web-tests/blink_tools diff > lighthouse-core/test/chromium-web-tests/blink-tools.patch` +Simply make your changes in `.tmp/chromium-web-tests/blink_tools/latest`, and run: `git -C .tmp/chromium-web-tests/blink_tools/latest diff > lighthouse-core/test/chromium-web-tests/blink-tools.patch` #### How does the python module `typ` get added to python sys path? diff --git a/lighthouse-core/test/chromium-web-tests/blink-tools.patch b/lighthouse-core/test/chromium-web-tests/blink-tools.patch index a793b1c082cf..5ea0ac348771 100644 --- a/lighthouse-core/test/chromium-web-tests/blink-tools.patch +++ b/lighthouse-core/test/chromium-web-tests/blink-tools.patch @@ -1,8 +1,8 @@ diff --git a/third_party/blink/tools/blinkpy/web_tests/controllers/manager.py b/third_party/blink/tools/blinkpy/web_tests/controllers/manager.py -index 693a95d..7890234 100644 +index 4323c8c..23ae146 100644 --- a/third_party/blink/tools/blinkpy/web_tests/controllers/manager.py +++ b/third_party/blink/tools/blinkpy/web_tests/controllers/manager.py -@@ -452,9 +452,9 @@ class Manager(object): +@@ -485,9 +485,9 @@ class Manager(object): if (self._port.requires_http_server() or any(self._is_http_test(test) for test in tests_to_run)): self._printer.write_update('Starting HTTP server ...') @@ -16,10 +16,21 @@ index 693a95d..7890234 100644 if any(self._is_websocket_test(test) for test in tests_to_run): diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base.py b/third_party/blink/tools/blinkpy/web_tests/port/base.py -index 6f5b188..0ae630e 100644 +index 8f5ff1a..b7f0ae5 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/base.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/base.py -@@ -495,15 +495,15 @@ class Port(object): +@@ -63,8 +63,8 @@ from blinkpy.web_tests.port.factory import PortFactory + from blinkpy.web_tests.servers import apache_http + from blinkpy.web_tests.servers import pywebsocket + from blinkpy.web_tests.servers import wptserve +-from blinkpy.web_tests.skia_gold import blink_skia_gold_properties as sgp +-from blinkpy.web_tests.skia_gold import blink_skia_gold_session_manager as sgsm ++# from blinkpy.web_tests.skia_gold import blink_skia_gold_properties as sgp ++# from blinkpy.web_tests.skia_gold import blink_skia_gold_session_manager as sgsm + + _log = logging.getLogger(__name__) + +@@ -541,15 +541,15 @@ class Port(object): self.get_option('configuration')): return exit_codes.UNEXPECTED_ERROR_EXIT_STATUS diff --git a/lighthouse-core/test/chromium-web-tests/download-blink-tools.sh b/lighthouse-core/test/chromium-web-tests/download-blink-tools.sh index d411ebfb0566..6271c2ecca25 100644 --- a/lighthouse-core/test/chromium-web-tests/download-blink-tools.sh +++ b/lighthouse-core/test/chromium-web-tests/download-blink-tools.sh @@ -13,9 +13,9 @@ set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # https://chromium.googlesource.com/chromium/src/ -commit_chromium="4ffbceb9e46813c0041c27d52fbcd180348ae073" +commit_chromium="e1c3b88f73fcbff831485c0ca37f877bd22b7a02" # https://chromium.googlesource.com/catapult/ -commit_catapult="370c3d98a6db53222e9f36a4491a3757bb93e61a" +commit_catapult="c2b4e773a8d77586ddea18b1962a3e02d19e682f" VERSIONED_DIR="$BLINK_TOOLS_PATH/$commit_chromium$commit_catapult" diff --git a/lighthouse-core/test/chromium-web-tests/web-test-server.sh b/lighthouse-core/test/chromium-web-tests/web-test-server.sh index c0e5ef340e83..73042a34b798 100644 --- a/lighthouse-core/test/chromium-web-tests/web-test-server.sh +++ b/lighthouse-core/test/chromium-web-tests/web-test-server.sh @@ -8,6 +8,11 @@ set -euo pipefail +if ! type -P python3; then + echo "python3 could not be found" + exit 1 +fi + # Get newest folder latest_content_shell_dir=$(ls -t "$LH_ROOT/.tmp/chromium-web-tests/content-shells/" | head -n1) export latest_content_shell="$LH_ROOT/.tmp/chromium-web-tests/content-shells/$latest_content_shell_dir" @@ -49,7 +54,7 @@ set +e # Print the python command. set -x -python \ +python3 \ "$BLINK_TOOLS_PATH/latest/third_party/blink/tools/run_web_tests.py" \ --layout-tests-directory="$DEVTOOLS_PATH/test/webtests" \ --build-directory="$latest_content_shell/out" \