2021-05-12 03:25:05 +03:00
|
|
|
name: "tests 1"
|
2021-05-12 03:01:02 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-12-08 09:58:33 +03:00
|
|
|
- main
|
2021-05-12 03:01:02 +03:00
|
|
|
- release-*
|
|
|
|
pull_request:
|
2021-05-12 03:25:05 +03:00
|
|
|
paths-ignore:
|
|
|
|
- 'browser_patches/**'
|
2021-06-01 23:55:48 +03:00
|
|
|
- 'docs/**'
|
2021-05-12 03:01:02 +03:00
|
|
|
branches:
|
2021-12-08 09:58:33 +03:00
|
|
|
- main
|
2021-05-12 03:01:02 +03:00
|
|
|
- release-*
|
|
|
|
|
2022-03-24 03:16:32 +03:00
|
|
|
concurrency:
|
|
|
|
# For pull requests, cancel all currently-running jobs for this workflow
|
|
|
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-05-12 03:01:02 +03:00
|
|
|
env:
|
|
|
|
# Force terminal colors. @see https://www.npmjs.com/package/colors
|
|
|
|
FORCE_COLOR: 1
|
|
|
|
FLAKINESS_CONNECTION_STRING: ${{ secrets.FLAKINESS_CONNECTION_STRING }}
|
2023-04-06 20:49:29 +03:00
|
|
|
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
2021-05-12 03:01:02 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test_linux:
|
2022-04-26 17:59:47 +03:00
|
|
|
name: ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }})
|
2021-05-12 03:01:02 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
browser: [chromium, firefox, webkit]
|
2022-08-03 22:34:41 +03:00
|
|
|
os: [ubuntu-22.04]
|
2023-05-18 00:32:38 +03:00
|
|
|
node-version: [16]
|
2022-04-26 17:59:47 +03:00
|
|
|
include:
|
2022-08-03 22:34:41 +03:00
|
|
|
- os: ubuntu-22.04
|
2022-04-26 17:59:47 +03:00
|
|
|
node-version: 18
|
|
|
|
browser: chromium
|
2023-05-30 19:16:34 +03:00
|
|
|
- os: ubuntu-22.04
|
|
|
|
node-version: 20
|
|
|
|
browser: chromium
|
2021-05-12 03:01:02 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2021-05-12 03:01:02 +03:00
|
|
|
with:
|
2022-04-26 17:59:47 +03:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-05-12 03:01:02 +03:00
|
|
|
- run: npm ci
|
2021-05-21 01:47:22 +03:00
|
|
|
env:
|
2022-09-29 22:08:28 +03:00
|
|
|
DEBUG: pw:install
|
2021-08-07 13:53:33 +03:00
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
2021-05-12 03:01:02 +03:00
|
|
|
- run: npm run build
|
2021-10-11 17:52:17 +03:00
|
|
|
- run: npx playwright install --with-deps ${{ matrix.browser }} chromium
|
2021-06-04 01:28:57 +03:00
|
|
|
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }}
|
2023-05-17 19:10:31 +03:00
|
|
|
env:
|
|
|
|
PWTEST_BLOB_REPORT: 1
|
2023-05-23 03:54:37 +03:00
|
|
|
PWTEST_BLOB_SUFFIX: "-${{ matrix.os }}-node${{ matrix.node-version }}"
|
2021-05-12 03:01:02 +03:00
|
|
|
- run: node tests/config/checkCoverage.js ${{ matrix.browser }}
|
|
|
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
|
|
|
if: always()
|
2022-08-05 11:47:44 +03:00
|
|
|
shell: bash
|
2023-05-19 23:31:37 +03:00
|
|
|
- name: Upload artifacts to Azure Blob Storage
|
|
|
|
if: always() && github.event_name != 'pull_request'
|
|
|
|
run: az storage blob upload-batch -s test-results/blob-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_linux' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
2021-05-12 03:01:02 +03:00
|
|
|
|
2023-05-17 19:10:31 +03:00
|
|
|
merge_test_linux:
|
|
|
|
if: ${{ always() && github.event_name != 'pull_request' }}
|
2023-05-25 00:43:36 +03:00
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
2023-05-17 19:10:31 +03:00
|
|
|
needs: [test_linux]
|
|
|
|
timeout-minutes: 10
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
2023-05-17 20:42:51 +03:00
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
|
|
|
- run: npm run build
|
2023-05-17 19:10:31 +03:00
|
|
|
- name: Download Blob Reports from Azure Blob Storage
|
|
|
|
run: |
|
2023-05-31 02:46:37 +03:00
|
|
|
run_dir='run-${{ github.run_id }}-${{ github.sha }}-test_linux'
|
|
|
|
mkdir -p $run_dir
|
|
|
|
LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")
|
|
|
|
for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');
|
|
|
|
do
|
|
|
|
az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
|
|
|
done
|
2023-05-17 19:10:31 +03:00
|
|
|
- name: Merge into HTML Report
|
|
|
|
run: |
|
|
|
|
npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-test_linux'
|
|
|
|
- name: Upload HTML Report to Azure Blob Storage
|
|
|
|
run: |
|
|
|
|
az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_linux' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
|
|
|
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-test_linux/index.html"
|
2023-05-25 00:43:36 +03:00
|
|
|
- name: Comment on PR
|
|
|
|
uses: actions/github-script@v6
|
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
|
|
|
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
|
|
|
...context.repo,
|
|
|
|
commit_sha: context.sha,
|
|
|
|
});
|
|
|
|
if (prs.length === 0) {
|
|
|
|
core.error('No pull request found for commit ' + context.sha);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const reportUrl = `https://mspwblobreport.z1.web.core.windows.net/run-${context.runId}-${context.sha}-test_linux/index.html`;
|
|
|
|
core.notice('Report url: ' + reportUrl);
|
|
|
|
const { data: response } = await github.rest.issues.createComment({
|
|
|
|
...context.repo,
|
|
|
|
issue_number: prs[0].number,
|
|
|
|
body: 'Primary test results: ' + reportUrl,
|
|
|
|
});
|
|
|
|
core.info('Posted comment: ' + response.html_url);
|
2023-05-17 19:10:31 +03:00
|
|
|
|
2023-06-01 01:29:57 +03:00
|
|
|
const { owner, repo } = context.repo;
|
|
|
|
|
|
|
|
const check = await github.rest.checks.create({
|
|
|
|
owner,
|
|
|
|
repo,
|
|
|
|
name: 'Primary Tests',
|
|
|
|
head_sha: context.sha,
|
|
|
|
status: 'completed',
|
|
|
|
conclusion: 'success',
|
|
|
|
details_url: reportUrl,
|
|
|
|
output: {
|
|
|
|
title: 'Merged Primary test results',
|
|
|
|
summary: 'Primary test results: ' + reportUrl,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-04-22 19:43:57 +03:00
|
|
|
test_linux_chromium_tot:
|
|
|
|
name: ${{ matrix.os }} (chromium tip-of-tree)
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-04-22 19:43:57 +03:00
|
|
|
with:
|
2023-02-10 02:53:32 +03:00
|
|
|
node-version: 16
|
2022-04-22 19:43:57 +03:00
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
|
|
|
- run: npm run build
|
|
|
|
- run: npx playwright install --with-deps chromium-tip-of-tree
|
|
|
|
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=chromium
|
|
|
|
env:
|
|
|
|
PWTEST_CHANNEL: chromium-tip-of-tree
|
|
|
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
|
|
|
if: always()
|
2022-08-05 11:47:44 +03:00
|
|
|
shell: bash
|
2022-04-22 19:43:57 +03:00
|
|
|
|
2022-03-01 09:19:15 +03:00
|
|
|
test_test_runner:
|
|
|
|
name: Test Runner
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2023-02-10 02:53:32 +03:00
|
|
|
node-version: [16]
|
2023-05-17 19:10:31 +03:00
|
|
|
shard: [1/2, 2/2]
|
2022-06-02 02:50:23 +03:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
node-version: 18
|
2023-05-17 19:42:40 +03:00
|
|
|
shard: 1/2
|
2023-05-17 19:10:31 +03:00
|
|
|
- os: ubuntu-latest
|
|
|
|
node-version: 18
|
2023-05-17 19:42:40 +03:00
|
|
|
shard: 2/2
|
2023-05-25 06:17:44 +03:00
|
|
|
- os: ubuntu-latest
|
|
|
|
node-version: 20
|
|
|
|
shard: 1/2
|
|
|
|
- os: ubuntu-latest
|
|
|
|
node-version: 20
|
|
|
|
shard: 2/2
|
2022-03-01 09:19:15 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-03-01 09:19:15 +03:00
|
|
|
with:
|
|
|
|
node-version: ${{matrix.node-version}}
|
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
- run: npm run build
|
|
|
|
- run: npx playwright install --with-deps
|
2023-05-17 19:10:31 +03:00
|
|
|
- run: npm run ttest -- --shard ${{ matrix.shard }}
|
|
|
|
env:
|
|
|
|
PWTEST_BLOB_REPORT: 1
|
2023-05-23 03:54:37 +03:00
|
|
|
PWTEST_BLOB_SUFFIX: "-${{ matrix.os }}-node${{ matrix.node-version }}"
|
2022-03-01 09:19:15 +03:00
|
|
|
if: matrix.os != 'ubuntu-latest'
|
2023-05-17 19:10:31 +03:00
|
|
|
- run: xvfb-run npm run ttest -- --shard ${{ matrix.shard }}
|
|
|
|
env:
|
|
|
|
PWTEST_BLOB_REPORT: 1
|
2023-05-23 03:54:37 +03:00
|
|
|
PWTEST_BLOB_SUFFIX: "-${{ matrix.os }}-node${{ matrix.node-version }}"
|
2022-03-01 09:19:15 +03:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
|
|
|
if: always()
|
2022-04-01 01:56:28 +03:00
|
|
|
shell: bash
|
2023-05-17 19:10:31 +03:00
|
|
|
- name: Upload artifacts to Azure Blob Storage
|
|
|
|
if: always() && github.event_name != 'pull_request'
|
|
|
|
run: az storage blob upload-batch -s test-results/blob-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
|
|
|
|
|
|
|
merge_test_test_runner:
|
|
|
|
if: ${{ always() && github.event_name != 'pull_request' }}
|
2023-05-25 00:43:36 +03:00
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
2023-05-17 19:10:31 +03:00
|
|
|
needs: [test_test_runner]
|
|
|
|
timeout-minutes: 10
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
2023-05-17 20:42:51 +03:00
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
|
|
|
- run: npm run build
|
2023-05-17 19:10:31 +03:00
|
|
|
- name: Download Blob Reports from Azure Blob Storage
|
|
|
|
run: |
|
2023-05-31 02:46:37 +03:00
|
|
|
run_dir='run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'
|
|
|
|
mkdir -p $run_dir
|
|
|
|
LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")
|
|
|
|
for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');
|
|
|
|
do
|
|
|
|
az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
|
|
|
done
|
2023-05-17 19:10:31 +03:00
|
|
|
- name: Merge into HTML Report
|
|
|
|
run: |
|
|
|
|
npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'
|
|
|
|
- name: Upload HTML Report to Azure Blob Storage
|
|
|
|
run: |
|
|
|
|
az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
|
|
|
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner/index.html"
|
2023-05-25 00:43:36 +03:00
|
|
|
- name: Comment on PR
|
|
|
|
uses: actions/github-script@v6
|
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
|
|
|
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
|
|
|
...context.repo,
|
|
|
|
commit_sha: context.sha,
|
|
|
|
});
|
|
|
|
if (prs.length === 0) {
|
|
|
|
core.error('No pull request found for commit ' + context.sha);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const reportUrl = `https://mspwblobreport.z1.web.core.windows.net/run-${context.runId}-${context.sha}-test_test_runner/index.html`;
|
|
|
|
core.notice('Report url: ' + reportUrl);
|
|
|
|
const { data: response } = await github.rest.issues.createComment({
|
|
|
|
...context.repo,
|
|
|
|
issue_number: prs[0].number,
|
|
|
|
body: 'Test Runner test results: ' + reportUrl,
|
|
|
|
});
|
|
|
|
core.info('Posted comment: ' + response.html_url);
|
2022-03-01 09:19:15 +03:00
|
|
|
|
2023-06-01 01:29:57 +03:00
|
|
|
const { owner, repo } = context.repo;
|
|
|
|
|
|
|
|
const check = await github.rest.checks.create({
|
|
|
|
owner,
|
|
|
|
repo,
|
|
|
|
name: 'Test Runner Tests',
|
|
|
|
head_sha: context.sha,
|
|
|
|
status: 'completed',
|
|
|
|
conclusion: 'success',
|
|
|
|
details_url: reportUrl,
|
|
|
|
output: {
|
|
|
|
title: 'Merged Test Runner Results',
|
|
|
|
summary: 'Test Runner test results: ' + reportUrl,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-03-29 23:27:37 +03:00
|
|
|
test_web_components:
|
|
|
|
name: Web Components
|
2021-12-14 05:30:48 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2021-12-14 05:30:48 +03:00
|
|
|
with:
|
2022-04-26 17:59:47 +03:00
|
|
|
node-version: 16
|
2021-12-14 05:30:48 +03:00
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
- run: npm run build
|
|
|
|
- run: npx playwright install --with-deps
|
2023-01-28 08:52:34 +03:00
|
|
|
- run: npm run test-html-reporter
|
|
|
|
- run: npm run test-web
|
2022-09-15 01:44:13 +03:00
|
|
|
if: always()
|
2022-05-03 22:48:35 +03:00
|
|
|
|
2023-05-25 23:34:38 +03:00
|
|
|
test_vscode_extension:
|
|
|
|
name: VSCode Extension
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
- run: npm run build
|
|
|
|
- run: npx playwright install chromium
|
|
|
|
- name: Checkout extension
|
|
|
|
run: git clone https://github.com/microsoft/playwright-vscode.git
|
|
|
|
- name: Print extension revision
|
|
|
|
run: git rev-parse HEAD
|
|
|
|
working-directory: ./playwright-vscode
|
|
|
|
- name: Remove @playwright/test from extension dependencies
|
|
|
|
run: node -e "const p = require('./package.json'); delete p.devDependencies['@playwright/test']; fs.writeFileSync('./package.json', JSON.stringify(p, null, 2));"
|
|
|
|
working-directory: ./playwright-vscode
|
|
|
|
- name: Build extension
|
|
|
|
run: npm install && npm run build
|
|
|
|
working-directory: ./playwright-vscode
|
|
|
|
- name: Run extension tests
|
|
|
|
run: npm run test -- --workers=1
|
|
|
|
working-directory: ./playwright-vscode
|
|
|
|
|
2022-05-03 22:48:35 +03:00
|
|
|
test-package-installations:
|
2023-05-18 00:32:38 +03:00
|
|
|
name: "Installation Test ${{ matrix.os }}"
|
2022-05-03 22:48:35 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-05-03 22:48:35 +03:00
|
|
|
with:
|
2023-05-18 00:32:38 +03:00
|
|
|
node-version: 16
|
2022-05-03 22:48:35 +03:00
|
|
|
- run: npm ci
|
|
|
|
env:
|
|
|
|
DEBUG: pw:install
|
|
|
|
- run: npm run build
|
|
|
|
- run: npx playwright install-deps
|
|
|
|
- run: npm run itest
|
|
|
|
if: matrix.os != 'ubuntu-latest'
|
|
|
|
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run itest
|
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2022-05-07 05:04:34 +03:00
|
|
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
|
|
|
if: always()
|
|
|
|
shell: bash
|
2022-09-15 01:05:18 +03:00
|
|
|
|