From 01be6f86659d5312e8e9b260b88008fec225fcec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Jul 2026 00:39:07 +0000 Subject: [PATCH] fix(e2e-tests): use pyppeteer bundled Chromium in containerized_chrome job Debian Bullseye (python:3.11-bullseye container) does not provide chromium-browser in its APT repos. Replace the broken apt-get install fallback chain with pyppeteer's own bundled Chromium download (download_chromium()), matching the pattern already used in aria-tests.yml. Also removes the now-unnecessary CHROME_PATH=/usr/bin/chromium env var so pyppeteer finds its bundled binary automatically, and extends test_aria_tests_workflow.py to guard both workflows against future regressions. --- .github/workflows/e2e-tests.yml | 33 +++++-------------------------- tests/test_aria_tests_workflow.py | 17 +++++++++++++++- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 832761f70..3da1545e4 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -204,36 +204,13 @@ jobs: run: | apt-get update apt-get install -y wget gnupg ca-certificates xz-utils fonts-liberation libgtk-3-0 libxss1 libasound2 libnss3 libatk-bridge2.0-0 libx11-xcb1 libgbm1 - - name: Install Chromium (stable) - # cspell:ignore elif - run: | - set -e - # Use Debian repo for chromium; package name varies by image/repo. - if apt-get install -y chromium chromium-driver; then - echo "Installed chromium + chromium-driver" - elif apt-get install -y chromium-browser; then - echo "Installed chromium-browser" - else - echo "Failed to install Chromium packages" >&2 - exit 1 - fi - - # Normalize executable path expected by CHROME_PATH. - if command -v chromium >/dev/null 2>&1; then - command -v chromium - elif command -v chromium-browser >/dev/null 2>&1; then - command -v chromium-browser - ln -sf "$(command -v chromium-browser)" /usr/bin/chromium - else - echo "Chromium executable not found after installation" >&2 - exit 1 - fi - - name: Install Python test deps + - name: Install Python test deps and Pyppeteer Chromium # cspell:ignore asyncio pyppeteer pytest - run: python -m pip install --upgrade pip && python -m pip install pytest pytest-asyncio pyppeteer requests + run: | + python -m pip install --upgrade pip + python -m pip install pytest pytest-asyncio pyppeteer requests + python -c "from pyppeteer.chromium_downloader import download_chromium; download_chromium()" - name: Start server and run pyppeteer tests - env: - CHROME_PATH: /usr/bin/chromium run: | python3 aria_web/server.py > /tmp/aria_server.log 2>&1 & READY=0 diff --git a/tests/test_aria_tests_workflow.py b/tests/test_aria_tests_workflow.py index df48b8c9e..f6b7d7a71 100644 --- a/tests/test_aria_tests_workflow.py +++ b/tests/test_aria_tests_workflow.py @@ -5,10 +5,25 @@ import pytest +_DOWNLOAD_CMD = 'python -c "from pyppeteer.chromium_downloader import download_chromium; download_chromium()"' + + @pytest.mark.unit def test_pyppeteer_workflow_uses_supported_chromium_download_command() -> None: workflow_path = Path(__file__).resolve().parents[1] / ".github" / "workflows" / "aria-tests.yml" content = workflow_path.read_text(encoding="utf-8") assert "python -m pyppeteer install" not in content - assert 'python -c "from pyppeteer.chromium_downloader import download_chromium; download_chromium()"' in content + assert _DOWNLOAD_CMD in content + + +@pytest.mark.unit +def test_e2e_tests_workflow_uses_pyppeteer_bundled_chromium() -> None: + """e2e-tests.yml containerized_chrome job must not try to apt-install chromium.""" + workflow_path = Path(__file__).resolve().parents[1] / ".github" / "workflows" / "e2e-tests.yml" + content = workflow_path.read_text(encoding="utf-8") + + # Must use pyppeteer bundled download — never apt-install chromium-browser (not in Bullseye) + assert "chromium-browser" not in content + assert "python -m pyppeteer install" not in content + assert _DOWNLOAD_CMD in content