Skip to content

fix: Use Playwright Docker image for CI to resolve dependency issues#69

Merged
aoshimash merged 4 commits into
mainfrom
fix/playwright-ci-docker-phase2
Jul 26, 2025
Merged

fix: Use Playwright Docker image for CI to resolve dependency issues#69
aoshimash merged 4 commits into
mainfrom
fix/playwright-ci-docker-phase2

Conversation

@aoshimash

Copy link
Copy Markdown
Owner

Summary

Fix the incomplete implementation of Phase 2 (#63) by using the official Playwright Docker image in CI, which includes all required system dependencies.

Problem

The CI environment (Ubuntu 24.04) was missing critical system dependencies for Playwright:

  • GTK4 libraries
  • GStreamer libraries
  • Various multimedia codecs
  • And many more

The playwright install --with-deps chromium command was insufficient due to package naming changes in Ubuntu 24.04 (many packages now have a t64 suffix).

Solution

Use the official Playwright Docker image (mcr.microsoft.com/playwright:v1.48.0-noble) which:

  • Has all system dependencies pre-installed
  • Is maintained by the Playwright team
  • Provides a consistent environment across CI runs
  • Eliminates dependency management complexity

Changes Made

  1. Added Docker container configuration to CI workflow
  2. Removed manual browser installation steps (already in Docker image)
  3. Set PLAYWRIGHT_BROWSERS_PATH environment variable
  4. Kept Playwright CLI installation for Go integration

Testing

This PR will validate that:

  • All tests pass in the Docker container
  • Playwright tests can run without dependency errors
  • CI performance remains acceptable

Related Issues

🤖 Generated with Claude Code

- Switch to official Playwright Docker image (mcr.microsoft.com/playwright:v1.48.0-noble)
- Remove manual browser installation steps as they're pre-installed in the image
- Set PLAYWRIGHT_BROWSERS_PATH environment variable to use pre-installed browsers
- Keep Playwright CLI installation for Go integration

This resolves all missing system dependencies that were preventing
Playwright tests from running in CI.

Fixes #68
- Install gcc, g++, and libc6-dev for CGO support
- Set CGO_ENABLED=1 for race detection
- Required for running tests with -race flag in Docker container
Allow running as root user to install system packages with apt-get
Fix 'dubious ownership' error by adding the workspace directory
to git's safe.directory list
@aoshimash aoshimash merged commit 8899ce7 into main Jul 26, 2025
4 checks passed
@aoshimash aoshimash deleted the fix/playwright-ci-docker-phase2 branch July 26, 2025 18:24
@aoshimash

Copy link
Copy Markdown
Owner Author

✅ CI成功!

すべてのCIチェックが成功しました。Playwright Dockerイメージを使用することで、依存関係の問題が解決されました。

実装内容

  1. Playwright公式Dockerイメージを使用(mcr.microsoft.com/playwright:v1.48.0-noble
  2. CGO有効化とビルドツールのインストール(gcc, g++, libc6-dev)
  3. Git所有権の問題を修正
  4. 環境変数でプリインストールされたブラウザを使用

結果

  • ✅ Test (Go 1.23): 3m24s
  • ✅ Test (Go 1.24): 2m51s
  • ✅ Build: 25s
  • ✅ Test: 38s

これでPhase 2が完了し、CI環境でPlaywrightテストを実行できるようになりました。次はPR #67に戻ってPhase 3を完了できます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Install missing system dependencies for Playwright in CI - Phase 2 Fix

1 participant