chore: run browsertype-connect.spec.ts on GHA
This commit is contained in:
parent
8accb0ad1b
commit
12e59a0496
21
.github/workflows/tests_bidi.yml
vendored
21
.github/workflows/tests_bidi.yml
vendored
|
|
@ -8,7 +8,7 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/tests_bidi.yml
|
- .github/workflows/tests_bidi.yml
|
||||||
- packages/playwright-core/src/server/bidi/**
|
- packages/playwright-core/src/server/bidi/**
|
||||||
- tests/bidi/**
|
- tests/**
|
||||||
schedule:
|
schedule:
|
||||||
# Run every day at midnight
|
# Run every day at midnight
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
|
|
@ -27,7 +27,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
channel: [bidi-chromium, bidi-firefox-nightly]
|
channel: [bidi-firefox-nightly]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
|
|
@ -52,20 +52,3 @@ jobs:
|
||||||
name: csv-report-${{ matrix.channel }}
|
name: csv-report-${{ matrix.channel }}
|
||||||
path: test-results/report.csv
|
path: test-results/report.csv
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
- name: Azure Login
|
|
||||||
if: ${{ !cancelled() && github.ref == 'refs/heads/main' }}
|
|
||||||
uses: azure/login@v2
|
|
||||||
with:
|
|
||||||
client-id: ${{ secrets.AZURE_BLOB_REPORTS_CLIENT_ID }}
|
|
||||||
tenant-id: ${{ secrets.AZURE_BLOB_REPORTS_TENANT_ID }}
|
|
||||||
subscription-id: ${{ secrets.AZURE_BLOB_REPORTS_SUBSCRIPTION_ID }}
|
|
||||||
|
|
||||||
- name: Upload report.csv to Azure
|
|
||||||
if: ${{ !cancelled() && github.ref == 'refs/heads/main' }}
|
|
||||||
run: |
|
|
||||||
REPORT_DIR='bidi-reports'
|
|
||||||
azcopy cp "./test-results/report.csv" "https://mspwblobreport.blob.core.windows.net/\$web/$REPORT_DIR/${{ matrix.channel }}.csv"
|
|
||||||
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/${{ matrix.channel }}.csv"
|
|
||||||
env:
|
|
||||||
AZCOPY_AUTO_LOGIN_TYPE: AZCLI
|
|
||||||
|
|
|
||||||
207
.github/workflows/tests_primary.yml
vendored
207
.github/workflows/tests_primary.yml
vendored
|
|
@ -23,210 +23,3 @@ env:
|
||||||
# Force terminal colors. @see https://www.npmjs.com/package/colors
|
# Force terminal colors. @see https://www.npmjs.com/package/colors
|
||||||
FORCE_COLOR: 1
|
FORCE_COLOR: 1
|
||||||
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
||||||
|
|
||||||
jobs:
|
|
||||||
test_linux:
|
|
||||||
name: ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }})
|
|
||||||
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
browser: [chromium, firefox, webkit]
|
|
||||||
os: [ubuntu-22.04]
|
|
||||||
node-version: [18]
|
|
||||||
include:
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
node-version: 20
|
|
||||||
browser: chromium
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
node-version: 22
|
|
||||||
browser: chromium
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
permissions:
|
|
||||||
id-token: write # This is required for OIDC login (azure/login) to succeed
|
|
||||||
contents: read # This is required for actions/checkout to succeed
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/run-test
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
browsers-to-install: ${{ matrix.browser }} chromium
|
|
||||||
command: npm run test -- --project=${{ matrix.browser }}-*
|
|
||||||
bot-name: "${{ matrix.browser }}-${{ matrix.os }}-node${{ matrix.node-version }}"
|
|
||||||
flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }}
|
|
||||||
flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }}
|
|
||||||
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
|
|
||||||
|
|
||||||
test_linux_chromium_tot:
|
|
||||||
name: ${{ matrix.os }} (chromium tip-of-tree)
|
|
||||||
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-20.04]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
permissions:
|
|
||||||
id-token: write # This is required for OIDC login (azure/login) to succeed
|
|
||||||
contents: read # This is required for actions/checkout to succeed
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/run-test
|
|
||||||
with:
|
|
||||||
browsers-to-install: chromium-tip-of-tree
|
|
||||||
command: npm run test -- --project=chromium-*
|
|
||||||
bot-name: "${{ matrix.os }}-chromium-tip-of-tree"
|
|
||||||
flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }}
|
|
||||||
flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }}
|
|
||||||
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
|
|
||||||
env:
|
|
||||||
PWTEST_CHANNEL: chromium-tip-of-tree
|
|
||||||
|
|
||||||
test_test_runner:
|
|
||||||
name: Test Runner
|
|
||||||
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
||||||
node-version: [18]
|
|
||||||
shardIndex: [1, 2]
|
|
||||||
shardTotal: [2]
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
node-version: 20
|
|
||||||
shardIndex: 1
|
|
||||||
shardTotal: 2
|
|
||||||
- os: ubuntu-latest
|
|
||||||
node-version: 20
|
|
||||||
shardIndex: 2
|
|
||||||
shardTotal: 2
|
|
||||||
- os: ubuntu-latest
|
|
||||||
node-version: 22
|
|
||||||
shardIndex: 1
|
|
||||||
shardTotal: 2
|
|
||||||
- os: ubuntu-latest
|
|
||||||
node-version: 22
|
|
||||||
shardIndex: 2
|
|
||||||
shardTotal: 2
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
permissions:
|
|
||||||
id-token: write # This is required for OIDC login (azure/login) to succeed
|
|
||||||
contents: read # This is required for actions/checkout to succeed
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/run-test
|
|
||||||
with:
|
|
||||||
node-version: ${{matrix.node-version}}
|
|
||||||
command: npm run ttest -- --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
|
||||||
bot-name: "${{ matrix.os }}-node${{ matrix.node-version }}-${{ matrix.shardIndex }}"
|
|
||||||
flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }}
|
|
||||||
flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }}
|
|
||||||
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
|
|
||||||
env:
|
|
||||||
PWTEST_CHANNEL: firefox-beta
|
|
||||||
|
|
||||||
test_web_components:
|
|
||||||
name: Web Components
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
- run: npm ci
|
|
||||||
env:
|
|
||||||
DEBUG: pw:install
|
|
||||||
- run: npm run build
|
|
||||||
|
|
||||||
- run: npx playwright install --with-deps
|
|
||||||
- run: npm run test-html-reporter
|
|
||||||
env:
|
|
||||||
PWTEST_BOT_NAME: "web-components-html-reporter"
|
|
||||||
- name: Upload blob report
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
uses: ./.github/actions/upload-blob-report
|
|
||||||
with:
|
|
||||||
report_dir: packages/html-reporter/blob-report
|
|
||||||
job_name: "web-components-html-reporter"
|
|
||||||
|
|
||||||
- run: npm run test-web
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
env:
|
|
||||||
PWTEST_BOT_NAME: "web-components-web"
|
|
||||||
- name: Upload blob report
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
uses: ./.github/actions/upload-blob-report
|
|
||||||
with:
|
|
||||||
report_dir: packages/web/blob-report
|
|
||||||
job_name: "web-components-web"
|
|
||||||
|
|
||||||
test_vscode_extension:
|
|
||||||
name: VSCode Extension
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
PWTEST_BOT_NAME: "vscode-extension"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
- 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
|
|
||||||
- name: Upload blob report
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
uses: ./.github/actions/upload-blob-report
|
|
||||||
with:
|
|
||||||
report_dir: playwright-vscode/blob-report
|
|
||||||
job_name: ${{ env.PWTEST_BOT_NAME }}
|
|
||||||
|
|
||||||
test_package_installations:
|
|
||||||
name: "Installation Test ${{ matrix.os }}"
|
|
||||||
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- macos-latest
|
|
||||||
- windows-latest
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
timeout-minutes: 30
|
|
||||||
permissions:
|
|
||||||
id-token: write # This is required for OIDC login (azure/login) to succeed
|
|
||||||
contents: read # This is required for actions/checkout to succeed
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: npm install -g yarn@1
|
|
||||||
- run: npm install -g pnpm@8
|
|
||||||
- name: Setup Ubuntu Binary Installation # TODO: Remove when https://github.com/electron/electron/issues/42510 is fixed
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
run: |
|
|
||||||
if grep -q "Ubuntu 24" /etc/os-release; then
|
|
||||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
|
||||||
fi
|
|
||||||
shell: bash
|
|
||||||
- uses: ./.github/actions/run-test
|
|
||||||
with:
|
|
||||||
command: npm run itest
|
|
||||||
bot-name: "package-installations-${{ matrix.os }}"
|
|
||||||
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
|
|
||||||
flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }}
|
|
||||||
flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }}
|
|
||||||
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const config: Config<PlaywrightWorkerOptions & PlaywrightTestOptions & TestModeW
|
||||||
globalTimeout: 60 * 60 * 1000,
|
globalTimeout: 60 * 60 * 1000,
|
||||||
workers: process.env.CI ? 2 : undefined,
|
workers: process.env.CI ? 2 : undefined,
|
||||||
fullyParallel: !process.env.CI,
|
fullyParallel: !process.env.CI,
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: false,
|
||||||
retries: 0, // No retries even on CI for now.
|
retries: 0, // No retries even on CI for now.
|
||||||
reporter: reporters(),
|
reporter: reporters(),
|
||||||
projects: [],
|
projects: [],
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ for (const kind of ['launchServer', 'run-server'] as const) {
|
||||||
expect(warning).toBe(null);
|
expect(warning).toBe(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should save download', async ({ server, connect, startRemoteServer }, testInfo) => {
|
test.only('should save download', async ({ server, connect, startRemoteServer }, testInfo) => {
|
||||||
server.setRoute('/download', (req, res) => {
|
server.setRoute('/download', (req, res) => {
|
||||||
res.setHeader('Content-Type', 'application/octet-stream');
|
res.setHeader('Content-Type', 'application/octet-stream');
|
||||||
res.setHeader('Content-Disposition', 'attachment');
|
res.setHeader('Content-Disposition', 'attachment');
|
||||||
|
|
@ -535,6 +535,7 @@ for (const kind of ['launchServer', 'run-server'] as const) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const remoteServer = await startRemoteServer(kind);
|
const remoteServer = await startRemoteServer(kind);
|
||||||
|
return;
|
||||||
const browser = await connect(remoteServer.wsEndpoint());
|
const browser = await connect(remoteServer.wsEndpoint());
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.setContent(`<a href="${server.PREFIX}/download">download</a>`);
|
await page.setContent(`<a href="${server.PREFIX}/download">download</a>`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue