mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: run primary tests with blob reporter (#23076)
This commit is contained in:
parent
94f928600d
commit
52feff39b3
67
.github/workflows/tests_primary.yml
vendored
67
.github/workflows/tests_primary.yml
vendored
@ -55,6 +55,11 @@ jobs:
|
|||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx playwright install --with-deps ${{ matrix.browser }} chromium
|
- run: npx playwright install --with-deps ${{ matrix.browser }} chromium
|
||||||
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }}
|
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }}
|
||||||
|
env:
|
||||||
|
PWTEST_BLOB_REPORT: 1
|
||||||
|
- 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 }}"
|
||||||
- run: node tests/config/checkCoverage.js ${{ matrix.browser }}
|
- run: node tests/config/checkCoverage.js ${{ matrix.browser }}
|
||||||
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
||||||
if: always()
|
if: always()
|
||||||
@ -65,6 +70,29 @@ jobs:
|
|||||||
name: ${{ matrix.browser }}-${{ matrix.os }}-test-results
|
name: ${{ matrix.browser }}-${{ matrix.os }}-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
|
merge_test_linux:
|
||||||
|
if: ${{ always() && github.event_name != 'pull_request' }}
|
||||||
|
needs: [test_linux]
|
||||||
|
timeout-minutes: 10
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
- name: Download Blob Reports from Azure Blob Storage
|
||||||
|
run: |
|
||||||
|
az storage blob download-batch -d . -s '$web' --pattern 'run-${{ github.run_id }}-${{ github.sha }}-test_linux/*.jsonl' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
||||||
|
- 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"
|
||||||
|
|
||||||
test_linux_chromium_tot:
|
test_linux_chromium_tot:
|
||||||
name: ${{ matrix.os }} (chromium tip-of-tree)
|
name: ${{ matrix.os }} (chromium tip-of-tree)
|
||||||
strategy:
|
strategy:
|
||||||
@ -103,9 +131,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
node-version: [16]
|
node-version: [16]
|
||||||
|
shard: [1/2, 2/2]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
shard: [1/2]
|
||||||
|
- os: ubuntu-latest
|
||||||
|
node-version: 18
|
||||||
|
shard: [2/2]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -118,13 +151,43 @@ jobs:
|
|||||||
DEBUG: pw:install
|
DEBUG: pw:install
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx playwright install --with-deps
|
- run: npx playwright install --with-deps
|
||||||
- run: npm run ttest
|
- run: npm run ttest -- --shard ${{ matrix.shard }}
|
||||||
|
env:
|
||||||
|
PWTEST_BLOB_REPORT: 1
|
||||||
if: matrix.os != 'ubuntu-latest'
|
if: matrix.os != 'ubuntu-latest'
|
||||||
- run: xvfb-run npm run ttest
|
- run: xvfb-run npm run ttest -- --shard ${{ matrix.shard }}
|
||||||
|
env:
|
||||||
|
PWTEST_BLOB_REPORT: 1
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
shell: bash
|
||||||
|
- 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' }}
|
||||||
|
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
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
- name: Download Blob Reports from Azure Blob Storage
|
||||||
|
run: |
|
||||||
|
az storage blob download-batch -d . -s '$web' --pattern 'run-${{ github.run_id }}-${{ github.sha }}-test_test_runner/*.jsonl' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
|
||||||
|
- 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"
|
||||||
|
|
||||||
test_web_components:
|
test_web_components:
|
||||||
name: Web Components
|
name: Web Components
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import { config as loadEnv } from 'dotenv';
|
import { config as loadEnv } from 'dotenv';
|
||||||
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
|
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
|
||||||
|
|
||||||
import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test';
|
import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription } from '@playwright/test';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import type { TestModeWorkerOptions } from '../config/testModeFixtures';
|
import type { TestModeWorkerOptions } from '../config/testModeFixtures';
|
||||||
import type { TestModeName } from '../config/testMode';
|
import type { TestModeName } from '../config/testMode';
|
||||||
@ -42,6 +42,17 @@ const trace = !!process.env.PWTEST_TRACE;
|
|||||||
|
|
||||||
const outputDir = path.join(__dirname, '..', '..', 'test-results');
|
const outputDir = path.join(__dirname, '..', '..', 'test-results');
|
||||||
const testDir = path.join(__dirname, '..');
|
const testDir = path.join(__dirname, '..');
|
||||||
|
const reporters = () => {
|
||||||
|
const result: ReporterDescription[] = process.env.CI ? [
|
||||||
|
['dot'],
|
||||||
|
['json', { outputFile: path.join(outputDir, 'report.json') }],
|
||||||
|
] : [
|
||||||
|
['html', { open: 'on-failure' }]
|
||||||
|
];
|
||||||
|
if (process.env.PWTEST_BLOB_REPORT === '1')
|
||||||
|
result.push(['blob', { outputDir: path.join(outputDir, 'blob-report') }]);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
const config: Config<CoverageWorkerOptions & PlaywrightWorkerOptions & PlaywrightTestOptions & TestModeWorkerOptions> = {
|
const config: Config<CoverageWorkerOptions & PlaywrightWorkerOptions & PlaywrightTestOptions & TestModeWorkerOptions> = {
|
||||||
testDir,
|
testDir,
|
||||||
outputDir,
|
outputDir,
|
||||||
@ -58,12 +69,7 @@ const config: Config<CoverageWorkerOptions & PlaywrightWorkerOptions & Playwrigh
|
|||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
preserveOutput: process.env.CI ? 'failures-only' : 'always',
|
preserveOutput: process.env.CI ? 'failures-only' : 'always',
|
||||||
retries: process.env.CI ? 3 : 0,
|
retries: process.env.CI ? 3 : 0,
|
||||||
reporter: process.env.CI ? [
|
reporter: reporters(),
|
||||||
['dot'],
|
|
||||||
['json', { outputFile: path.join(outputDir, 'report.json') }],
|
|
||||||
] : [
|
|
||||||
['html', { open: 'on-failure' }]
|
|
||||||
],
|
|
||||||
projects: [],
|
projects: [],
|
||||||
use: {
|
use: {
|
||||||
connectOptions: mode === 'service' ? {
|
connectOptions: mode === 'service' ? {
|
||||||
|
@ -17,10 +17,21 @@
|
|||||||
import { config as loadEnv } from 'dotenv';
|
import { config as loadEnv } from 'dotenv';
|
||||||
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
|
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
|
||||||
|
|
||||||
import { defineConfig } from './stable-test-runner';
|
import { defineConfig, type ReporterDescription } from './stable-test-runner';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
const outputDir = path.join(__dirname, '..', '..', 'test-results');
|
const outputDir = path.join(__dirname, '..', '..', 'test-results');
|
||||||
|
const reporters = () => {
|
||||||
|
const result: ReporterDescription[] = process.env.CI ? [
|
||||||
|
['dot'],
|
||||||
|
['json', { outputFile: path.join(outputDir, 'report.json') }],
|
||||||
|
] : [
|
||||||
|
['list']
|
||||||
|
];
|
||||||
|
if (process.env.PWTEST_BLOB_REPORT === '1')
|
||||||
|
result.push(['blob', { outputDir: path.join(outputDir, 'blob-report') }]);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
@ -39,10 +50,5 @@ export default defineConfig({
|
|||||||
testIgnore: [path.join(__dirname, '../fixtures/**')],
|
testIgnore: [path.join(__dirname, '../fixtures/**')],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
reporter: process.env.CI ? [
|
reporter: reporters(),
|
||||||
['dot'],
|
|
||||||
['json', { outputFile: path.join(outputDir, 'report.json') }],
|
|
||||||
] : [
|
|
||||||
['list']
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user