Skip to content

Commit

Permalink
ci: add e2e report
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Nov 19, 2024
1 parent 8602e4e commit cca2e65
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ jobs:
compression-level: 0
retention-days: 1

- name: Upload reports / ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}
uses: actions/[email protected]
with:
path: ./projects/demo-playwright/blob-report
name: blob-reports__${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}-${{ github.run_id }}-${{ github.job }}
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:
Expand All @@ -213,6 +221,7 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]

- name: Download artifacts for Playwright
continue-on-error: true
Expand All @@ -223,6 +232,15 @@ jobs:
merge-multiple: true
- run: ls -R ./total/playwright || echo "not found"

- name: Download artifacts for Playwright
continue-on-error: true
uses: actions/[email protected]
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/[email protected]
Expand All @@ -232,6 +250,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/[email protected]
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/[email protected]
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: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ RELEASE_BODY.md
projects/demo/routes.txt
migrations.json
sitemap.xml
blob-report
4 changes: 3 additions & 1 deletion projects/demo-playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cca2e65

Please sign in to comment.