From 6c780e0bdc003c19ef9d450fbed797c05dbcda56 Mon Sep 17 00:00:00 2001 From: splincode Date: Tue, 19 Nov 2024 11:54:23 +0300 Subject: [PATCH] ci: add e2e report --- .github/workflows/e2e.yml | 40 +++++++++++++++++++ .gitignore | 1 + projects/demo-playwright/playwright.config.ts | 4 +- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 71e5ab06b8e4..90ea78c6ed04 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -188,6 +188,17 @@ jobs: compression-level: 0 retention-days: 1 + - name: + Upload reports / blob-reports_${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_${{ matrix.shard.os }}_${{ + matrix.shard.index }} + uses: actions/upload-artifact@v4.4.3 + with: + path: ./projects/demo-playwright/blob-report + name: + blob-reports_${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_${{ matrix.shard.os }}_${{ matrix.shard.index }} + compression-level: 0 + retention-days: 1 + # workaround for status checks -- check this one job instead of each individual E2E job in the matrix # see https://github.com/orgs/community/discussions/9141#discussioncomment-2296809 playwright-composite-result: @@ -213,6 +224,7 @@ jobs: steps: - uses: actions/checkout@v4.2.2 - uses: taiga-family/ci/actions/setup/variables@v1.96.0 + - uses: taiga-family/ci/actions/setup/node@v1.96.0 - name: Download artifacts for Playwright continue-on-error: true @@ -223,6 +235,15 @@ jobs: merge-multiple: true - run: ls -R ./total/playwright || echo "not found" + - name: Download artifacts for Playwright + continue-on-error: true + uses: actions/download-artifact@v4.1.8 + with: + path: all-blob-reports + pattern: blob-reports_${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_* + merge-multiple: true + - run: ls -R ./all-blob-reports || echo "not found" + - name: Download artifacts for Cypress continue-on-error: true uses: actions/download-artifact@v4.1.8 @@ -232,6 +253,25 @@ jobs: merge-multiple: true - run: ls -R ./total/cypress || echo "not found" + - name: Merge into HTML Report + run: npx playwright merge-reports --reporter html,json ./all-blob-reports + + - name: Upload HTML report + uses: actions/upload-artifact@v4.4.3 + id: upload-merged-playwright-report-step + with: + name: html-report--attempt-${{ github.run_attempt }} + path: playwright-report + retention-days: 1 + + - name: Create report comment + id: report-summary + uses: daun/playwright-report-summary@v3.6.0 + with: + comment-title: 'Playwright test results' + report-file: ./playwright-report/results.json + report-url: ${{ steps.upload-merged-playwright-report-step.outputs.artifact-url }} + - name: Check if diff-output exists id: diff_checker run: | diff --git a/.gitignore b/.gitignore index 2e4002d3506e..6954ec655c3f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ RELEASE_BODY.md projects/demo/routes.txt migrations.json sitemap.xml +blob-report diff --git a/projects/demo-playwright/playwright.config.ts b/projects/demo-playwright/playwright.config.ts index 5e46402c40d9..0cc01bc137b1 100644 --- a/projects/demo-playwright/playwright.config.ts +++ b/projects/demo-playwright/playwright.config.ts @@ -16,7 +16,9 @@ export default defineConfig({ testMatch: '**/*.pw.spec.ts', outputDir: 'tests-results', snapshotDir: 'snapshots', - reporter: process.env.CI ? 'github' : [['html', {outputFolder: 'tests-report'}]], + reporter: process.env.CI + ? [['blob'], ['github']] + : [['html', {outputFolder: 'tests-report'}]], fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI,