fixup! Add browsers for tests: Playwright, Firefox, geckodriver, headless Chrome (closes #10)

Model: deepseek-v4-pro
This commit is contained in:
2026-11-05 15:03:13 +00:00
parent 63eb889a19
commit ffd28be744
2 changed files with 26 additions and 8 deletions
+14 -5
View File
@@ -99,10 +99,15 @@ curl -fsSL https://packages.mozilla.org/apt/repo-signing-key.gpg \
-o /etc/apt/keyrings/packages.mozilla.org.asc
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" \
> /etc/apt/sources.list.d/mozilla.list
cat > /etc/apt/preferences.d/mozilla <<'EOF'
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
EOF
apt-get update
apt-get -y install --no-install-recommends -t mozilla firefox
# geckodriver, matched to Firefox at its current release.
# geckodriver, at its latest release (independent of the Firefox version).
gd="$(latest_tag mozilla/geckodriver)"
case "$arch" in
arm64) gd_arch=linux-aarch64 ;;
@@ -111,12 +116,16 @@ esac
curl -fsSL "https://github.com/mozilla/geckodriver/releases/download/${gd}/geckodriver-${gd}-${gd_arch}.tar.gz" |
tar -C /usr/local/bin -xz geckodriver
# Playwright's Chromium and Firefox. WebKit has no linux-arm64 build, so it
# is skipped. Playwright's Chromium is also the headless Chrome for
# Playwright's Chromium and Firefox. WebKit is skipped because no repository
# uses it today. Playwright's Chromium is also the headless Chrome for
# chromedp-style clients, exposed as `chromium` on PATH.
playwright install --with-deps chromium firefox
ln -s "$(ls -d "$PLAYWRIGHT_BROWSERS_PATH"/chromium-*/chrome-linux*/chrome | head -n1)" \
/usr/local/bin/chromium
chromiums=( "$PLAYWRIGHT_BROWSERS_PATH"/chromium-*/chrome-linux*/chrome )
if [ "${#chromiums[@]}" -ne 1 ] || [ ! -x "${chromiums[0]}" ]; then
echo "error: expected exactly one chromium binary, found ${#chromiums[@]}" >&2
exit 1
fi
ln -s "${chromiums[0]}" /usr/local/bin/chromium
# --- pyenv, Python (latest), pip, virtualenv ---------------------------------
git clone -q --depth 1 --branch "$PYENV_GIT_TAG" https://github.com/pyenv/pyenv.git "$PYENV_ROOT"