2023-10-11 17:26:48 +00:00
|
|
|
name: Deflake Puppeteer test
|
|
|
|
|
|
|
|
# Declare default permissions as read only.
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: deflake-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tests:
|
|
|
|
description: Tests to deflake (e.g. '[network.spec] *')
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
suite:
|
|
|
|
description: Which suite to run?
|
|
|
|
required: true
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- chrome-headless
|
|
|
|
- chrome-headful
|
2024-02-02 12:25:43 +00:00
|
|
|
- chrome-headless-shell
|
2023-10-11 17:26:48 +00:00
|
|
|
- chrome-bidi
|
|
|
|
- firefox-headful
|
|
|
|
- firefox-headless
|
|
|
|
- firefox-bidi
|
|
|
|
os:
|
|
|
|
description: On which OS to run?
|
|
|
|
required: true
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- ubuntu-latest
|
|
|
|
- windows-latest
|
2024-04-25 10:02:30 +00:00
|
|
|
- macos-13
|
2023-10-11 17:26:48 +00:00
|
|
|
retries:
|
|
|
|
description: Number of retries per test
|
|
|
|
required: false
|
2023-10-13 12:13:54 +00:00
|
|
|
default: 100
|
2023-10-11 17:26:48 +00:00
|
|
|
type: number
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
chrome-deflake:
|
|
|
|
name: Deflake test with pattern ${{ inputs.tests }} on ${{ inputs.os }}
|
|
|
|
runs-on: ${{ inputs.os }}
|
|
|
|
if: ${{ contains(inputs.suite, 'chrome') }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
2024-05-21 08:14:13 +00:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Set up Node.js
|
2024-02-12 09:49:18 +00:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
with:
|
|
|
|
cache: npm
|
2024-01-24 10:27:35 +00:00
|
|
|
node-version-file: '.nvmrc'
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
env:
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
|
|
# Set up GitHub Actions caching for Wireit.
|
2024-02-21 09:37:35 +00:00
|
|
|
- uses: google/wireit@4aad131006ea85c1e42af927534ebb13426dd730 # setup-github-actions-caching/v1.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Build packages
|
2023-11-10 13:45:37 +00:00
|
|
|
run: npm run build -w @puppeteer-test/test
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Setup cache for Chrome binary
|
|
|
|
if: ${{ inputs.suite != 'chrome-bidi' }}
|
2024-03-25 15:44:44 +00:00
|
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
with:
|
|
|
|
path: ~/.cache/puppeteer/chrome
|
2024-01-31 17:06:51 +00:00
|
|
|
key: Chrome-${{ runner.os }}-${{ hashFiles('packages/puppeteer-core/src/revisions.ts') }}-${{ hashFiles('packages/puppeteer/src/node/install.ts') }}
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Install Chrome
|
|
|
|
if: ${{ inputs.suite != 'chrome-bidi' }}
|
|
|
|
run: npm run postinstall
|
|
|
|
- name: Setup cache for Chrome Canary binary
|
|
|
|
if: ${{ inputs.suite == 'chrome-bidi' }}
|
2024-03-25 15:44:44 +00:00
|
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
with:
|
|
|
|
path: ~/.cache/puppeteer/chrome-canary
|
2024-01-31 17:06:51 +00:00
|
|
|
key: Chrome-Canary-${{ runner.os }}-${{ hashFiles('package.json') }}
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Install Chrome Canary
|
|
|
|
if: ${{ inputs.suite == 'chrome-bidi' }}
|
|
|
|
id: browser
|
|
|
|
run: node tools/download_chrome_bidi.mjs ~/.cache/puppeteer/chrome-canary
|
|
|
|
- name: Run all tests (for non-Linux)
|
|
|
|
if: ${{ inputs.os != 'ubuntu-latest' }}
|
|
|
|
run: npm run test -- --test-suite ${{ inputs.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
|
|
|
|
env:
|
|
|
|
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
|
2023-10-12 17:08:49 +00:00
|
|
|
PUPPETEER_DEFLAKE_TESTS: '${{ inputs.tests }}'
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Run all tests (for Linux)
|
|
|
|
if: ${{ inputs.os == 'ubuntu-latest' }}
|
|
|
|
run: xvfb-run --auto-servernum npm run test -- --test-suite ${{ inputs.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
|
|
|
|
env:
|
|
|
|
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
|
2023-10-12 17:08:49 +00:00
|
|
|
PUPPETEER_DEFLAKE_TESTS: '${{ inputs.tests }}'
|
2023-10-11 17:26:48 +00:00
|
|
|
PUPPETEER_DEFLAKE_RETRIES: ${{ inputs.retries }}
|
|
|
|
|
|
|
|
firefox-tests:
|
|
|
|
name: Deflake test with pattern ${{ inputs.tests }} on ${{ inputs.os }}
|
|
|
|
runs-on: ${{ inputs.os }}
|
|
|
|
if: ${{ contains(inputs.suite, 'firefox') }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-21 08:14:13 +00:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Set up Node.js
|
2024-02-12 09:49:18 +00:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
with:
|
|
|
|
cache: npm
|
2024-01-24 10:27:35 +00:00
|
|
|
node-version-file: '.nvmrc'
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
env:
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
|
|
# Set up GitHub Actions caching for Wireit.
|
2024-02-21 09:37:35 +00:00
|
|
|
- uses: google/wireit@4aad131006ea85c1e42af927534ebb13426dd730 # setup-github-actions-caching/v1.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Build packages
|
2023-11-10 13:45:37 +00:00
|
|
|
run: npm run build -w @puppeteer-test/test
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Setup cache for Firefox binary
|
2024-03-25 15:44:44 +00:00
|
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
2023-10-11 17:26:48 +00:00
|
|
|
with:
|
|
|
|
path: ~/.cache/puppeteer/firefox
|
2024-01-31 17:06:51 +00:00
|
|
|
key: Firefox-${{ runner.os }}-${{ hashFiles('packages/puppeteer-core/src/revisions.ts') }}-${{ hashFiles('packages/puppeteer/src/node/install.ts') }}
|
2023-10-11 17:26:48 +00:00
|
|
|
- name: Install Firefox
|
|
|
|
env:
|
|
|
|
PUPPETEER_PRODUCT: firefox
|
|
|
|
run: npm run postinstall
|
|
|
|
- name: Run all tests (for non-Linux)
|
|
|
|
if: ${{ inputs.os != 'ubuntu-latest' }}
|
|
|
|
run: npm run test -- --test-suite ${{ inputs.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
|
|
|
|
env:
|
2023-10-12 17:08:49 +00:00
|
|
|
PUPPETEER_DEFLAKE_TESTS: '${{ inputs.tests }}'
|
2023-10-11 17:26:48 +00:00
|
|
|
PUPPETEER_DEFLAKE_RETRIES: ${{ inputs.retries }}
|
|
|
|
- name: Run all tests (for Linux)
|
|
|
|
if: ${{ inputs.os == 'ubuntu-latest' }}
|
|
|
|
run: xvfb-run --auto-servernum npm run test -- --test-suite ${{ inputs.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
|
|
|
|
env:
|
2023-10-12 17:08:49 +00:00
|
|
|
PUPPETEER_DEFLAKE_TESTS: '${{ inputs.tests }}'
|
2023-10-11 17:26:48 +00:00
|
|
|
PUPPETEER_DEFLAKE_RETRIES: ${{ inputs.retries }}
|