Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(install-browsers): automatically detect out of sync playwright deps and attempt to install #77

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

barbados-clemens
Copy link
Contributor

@barbados-clemens barbados-clemens commented Dec 3, 2024

Sometimes when playwright releases a new version the system deps
required also change. This change attempts to catch the out of sync deps
from a playwright warning, and then install the deps playwright needs to
prevent hard to debug issues with playwright not working.

working here: https://staging.nx.app/cipes/6781992b5c0e286a78bb1165?step=f133e59a-7e48-4267-854d-3390779377d6&instance=job-6781992b5c0e286a78bb1166-0-agent-0&launchTemplate=custom-linux-medium-js#step-list-pane

example output:

 Playwright Host validation warning: 
69   ╔══════════════════════════════════════════════════════╗
70   ║ Host system is missing dependencies to run browsers. ║
71   ║ Please install them with the following command:      ║
72   ║                                                      ║
73   ║     sudo npx playwright install-deps                 ║
74   ║                                                      ║
75   ║ Alternatively, use apt:                              ║
76   ║     sudo apt-get install libavif13                   ║
77   ║                                                      ║
78   ║ <3 Playwright Team                                   ║
79   ╚══════════════════════════════════════════════════════╝
80       at validateDependenciesLinux (/home/workflows/workspace/node_modules/playwright-core/lib/server/registry/dependencies.js:216:9)
81       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
82       at async Registry._validateHostRequirements (/home/workflows/workspace/node_modules/playwright-core/lib/server/registry/index.js:753:43)
83       at async Registry._validateHostRequirementsForExecutableIfNeeded (/home/workflows/workspace/node_modules/playwright-core/lib/server/registry/index.js:851:7)
84       at async Registry.validateHostRequirementsForExecutablesIfNeeded (/home/workflows/workspace/node_modules/playwright-core/lib/server/registry/index.js:840:43)
85       at async t.<anonymous> (/home/workflows/workspace/node_modules/playwright-core/lib/cli/program.js:137:7)
86   Detected missing Playwright dependencies. Attempting manual install...
87   Installing Playwright dependencies:
88   sudo apt-get install libavif13 -y

Copy link

nx-cloud bot commented Dec 3, 2024

View your CI Pipeline Execution ↗ for commit edbbf56.

Command Status Duration Result
nx affected -t test ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-10 22:11:44 UTC

@barbados-clemens barbados-clemens force-pushed the feat-auto-install-playwright-deps branch from bc09276 to a5874af Compare December 16, 2024 14:34
@barbados-clemens barbados-clemens force-pushed the feat-auto-install-playwright-deps branch 15 times, most recently from 0fe33f4 to 02c5b9c Compare January 10, 2025 22:07
…eps and attempt to install

Sometimes when playwright releases a new version the system deps
required also change. This change attempts to catch the out of sync deps
from a playwright warning, and then install the deps playwright needs to
prevent hard to debug issues with playwright not working.
@barbados-clemens barbados-clemens force-pushed the feat-auto-install-playwright-deps branch from 02c5b9c to f8a2cf5 Compare January 10, 2025 22:07
@barbados-clemens barbados-clemens self-assigned this Jan 10, 2025
@barbados-clemens barbados-clemens marked this pull request as ready for review January 10, 2025 22:08
@barbados-clemens barbados-clemens force-pushed the feat-auto-install-playwright-deps branch from f8a2cf5 to edbbf56 Compare January 10, 2025 22:11
@barbados-clemens barbados-clemens added the enhancement New feature or request label Jan 10, 2025
@barbados-clemens barbados-clemens merged commit 26ea4bd into main Jan 13, 2025
2 checks passed
@barbados-clemens barbados-clemens deleted the feat-auto-install-playwright-deps branch January 13, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants