From 39a6b233090a1b76554f78ab645c9d283f0d4e40 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 24 Aug 2023 16:06:41 -0700 Subject: [PATCH] devops: create blob reports for all "tests 1" (#26694) --- .github/workflows/tests_primary.yml | 34 ++++++++++++++++++++- packages/html-reporter/playwright.config.ts | 2 +- packages/web/playwright.config.ts | 13 +++++++- tests/installation/playwright.config.ts | 18 ++++++++--- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml index 4fa4749af2..3a04dc9ae2 100644 --- a/.github/workflows/tests_primary.yml +++ b/.github/workflows/tests_primary.yml @@ -158,10 +158,26 @@ jobs: env: DEBUG: pw:install - run: npm run build + - run: npx playwright install --with-deps - run: npm run test-html-reporter + env: + PWTEST_BLOB_REPORT_NAME: "web-components-html-reporter" + - name: Upload blob report + if: always() + uses: ./.github/actions/upload-blob-report + with: + report_dir: packages/html-reporter/blob-report + - run: npm run test-web if: always() + env: + PWTEST_BLOB_REPORT_NAME: "web-components-web" + - name: Upload blob report + if: always() + uses: ./.github/actions/upload-blob-report + with: + report_dir: packages/web/blob-report test_vscode_extension: name: VSCode Extension @@ -189,9 +205,16 @@ jobs: working-directory: ./playwright-vscode - name: Run extension tests run: npm run test -- --workers=1 + env: + PWTEST_BLOB_REPORT_NAME: "vscode-extension" working-directory: ./playwright-vscode + - name: Upload blob report + if: always() + uses: ./.github/actions/upload-blob-report + with: + report_dir: ./playwright-vscode/blob-report - test-package-installations: + test_package_installations: name: "Installation Test ${{ matrix.os }}" runs-on: ${{ matrix.os }} strategy: @@ -214,8 +237,17 @@ jobs: - run: npx playwright install-deps - run: npm run itest if: matrix.os != 'ubuntu-latest' + env: + PWTEST_BLOB_REPORT_NAME: "package-installations-${{ matrix.os }}" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run itest if: matrix.os == 'ubuntu-latest' + env: + PWTEST_BLOB_REPORT_NAME: "package-installations-${{ matrix.os }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash + - name: Upload blob report + if: always() + uses: ./.github/actions/upload-blob-report + with: + report_dir: blob-report diff --git a/packages/html-reporter/playwright.config.ts b/packages/html-reporter/playwright.config.ts index 41140fb50c..aa3c5e0494 100644 --- a/packages/html-reporter/playwright.config.ts +++ b/packages/html-reporter/playwright.config.ts @@ -21,7 +21,7 @@ export default defineConfig({ forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, snapshotPathTemplate: '{testDir}/__screenshots__/{projectName}/{testFilePath}/{arg}{ext}', - reporter: 'html', + reporter: process.env.CI ? 'blob' : 'html', use: { ctPort: 3101, trace: 'on-first-retry', diff --git a/packages/web/playwright.config.ts b/packages/web/playwright.config.ts index 18ad0df47a..8169cfa661 100644 --- a/packages/web/playwright.config.ts +++ b/packages/web/playwright.config.ts @@ -15,12 +15,23 @@ */ import { devices, defineConfig } from '@playwright/experimental-ct-react'; +import type { ReporterDescription } from '@playwright/test'; + +const reporters = () => { + const result: ReporterDescription[] = process.env.CI ? [ + ['html'], + ['blob'], + ] : [ + ['html'] + ]; + return result; +}; export default defineConfig({ testDir: 'src', forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, - reporter: 'html', + reporter: reporters(), use: { ctPort: 3102, trace: 'on-first-retry', diff --git a/tests/installation/playwright.config.ts b/tests/installation/playwright.config.ts index 882f5bfaad..fc3dda9023 100644 --- a/tests/installation/playwright.config.ts +++ b/tests/installation/playwright.config.ts @@ -16,9 +16,22 @@ import path from 'path'; import { defineConfig } from '@playwright/test'; +import type { ReporterDescription } from '@playwright/test'; import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); +const reporters = () => { + const result: ReporterDescription[] = process.env.CI ? [ + ['dot'], + ['json', { outputFile: path.join(outputDir, 'report.json') }], + ['blob'], + ] : [ + ['list'], + ['html', { open: 'on-failure' }] + ]; + return result; +}; + const outputDir = path.join(__dirname, '..', '..', 'test-results'); export default defineConfig({ globalSetup: path.join(__dirname, 'globalSetup'), @@ -26,10 +39,7 @@ export default defineConfig({ testIgnore: '**\/fixture-scripts/**', timeout: 5 * 60 * 1000, retries: 0, - reporter: process.env.CI ? [ - ['dot'], - ['json', { outputFile: path.join(outputDir, 'report.json') }], - ] : [['list'], ['html', { open: 'on-failure' }]], + reporter: reporters(), forbidOnly: !!process.env.CI, workers: 1, projects: [