From 718bd9b35fd206245401a9ecb320289f427592d9 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Sat, 7 Sep 2024 09:16:42 +0200 Subject: [PATCH] devops: run BiDi tests (#32493) --- .github/workflows/tests_bidi.yml | 42 +++++++++++++++++++ .../src/server/registry/index.ts | 7 +++- tests/bidi/playwright.config.ts | 8 ++-- 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/tests_bidi.yml diff --git a/.github/workflows/tests_bidi.yml b/.github/workflows/tests_bidi.yml new file mode 100644 index 0000000000000..433294dbea6a9 --- /dev/null +++ b/.github/workflows/tests_bidi.yml @@ -0,0 +1,42 @@ +name: tests BiDi + +on: + workflow_dispatch: + pull_request: + branches: + - main + paths: + - .github/workflows/tests_bidi.yml + schedule: + # Run every day at midnight + - cron: '0 0 * * *' + +env: + FORCE_COLOR: 1 + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 + +jobs: + test_bidi: + name: BiDi + environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }} + runs-on: ubuntu-24.04 + permissions: + id-token: write # This is required for OIDC login (azure/login) to succeed + contents: read # This is required for actions/checkout to succeed + strategy: + fail-fast: false + matrix: + # TODO: add Firefox + channel: [bidi-chrome-stable] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + env: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' + - run: npm run build + - run: npx playwright install --with-deps chromium + - name: Run tests + run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run biditest -- --project=${{ matrix.channel }}* diff --git a/packages/playwright-core/src/server/registry/index.ts b/packages/playwright-core/src/server/registry/index.ts index cafef726fb37a..058e0bcbc34b4 100644 --- a/packages/playwright-core/src/server/registry/index.ts +++ b/packages/playwright-core/src/server/registry/index.ts @@ -354,7 +354,7 @@ function readDescriptors(browsersJSON: BrowsersJSON) { export type BrowserName = 'chromium' | 'firefox' | 'webkit' | 'bidi'; type InternalTool = 'ffmpeg' | 'firefox-beta' | 'chromium-tip-of-tree' | 'android'; -type BidiChannel = 'bidi-firefox-stable' | 'bidi-chrome-canary'; +type BidiChannel = 'bidi-firefox-stable' | 'bidi-chrome-canary' | 'bidi-chrome-stable'; type ChromiumChannel = 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary' | 'msedge' | 'msedge-beta' | 'msedge-dev' | 'msedge-canary'; const allDownloadable = ['chromium', 'firefox', 'webkit', 'ffmpeg', 'firefox-beta', 'chromium-tip-of-tree']; @@ -530,6 +530,11 @@ export class Registry { 'darwin': '/Applications/Firefox.app/Contents/MacOS/firefox', 'win32': '\\Mozilla Firefox\\firefox.exe', })); + this._executables.push(this._createBidiChannel('bidi-chrome-stable', { + 'linux': '/opt/google/chrome/chrome', + 'darwin': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', + 'win32': `\\Google\\Chrome\\Application\\chrome.exe`, + })); this._executables.push(this._createBidiChannel('bidi-chrome-canary', { 'linux': '', 'darwin': '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary', diff --git a/tests/bidi/playwright.config.ts b/tests/bidi/playwright.config.ts index 7adaa56638e59..bc7b29e56bc8a 100644 --- a/tests/bidi/playwright.config.ts +++ b/tests/bidi/playwright.config.ts @@ -47,9 +47,9 @@ const config: Config