From d89a32acd4ddb0fa536f00798a7e43ef6c17092b Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Sun, 2 Apr 2023 21:56:55 +0900 Subject: Make playwright_comment work even when there are retries / flaky tests --- .github/workflows/playwright_comment.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/playwright_comment.yml b/.github/workflows/playwright_comment.yml index 6b50631d..65576f87 100644 --- a/.github/workflows/playwright_comment.yml +++ b/.github/workflows/playwright_comment.yml @@ -41,7 +41,7 @@ jobs: echo "MASTER_SCREENSHOTS_OUTCOME<<$EOF" >> $GITHUB_OUTPUT cat ./master-screenshots-outcome >> $GITHUB_OUTPUT echo "$EOF" >> $GITHUB_OUTPUT - echo "NUM_FAILED=$(grep -c 'Screenshot comparison failed' $GITHUB_OUTPUT)" >> $GITHUB_OUTPUT + echo "FAILED=$(grep -c '^ *[0-9] failed$' $GITHUB_OUTPUT)" >> $GITHUB_OUTPUT # this is required because github.event.workflow_run.pull_requests is not available for PRs from forks - name: "Get PR information" @@ -61,24 +61,26 @@ jobs: - name: "[Comment] Success: No visual differences introduced by this PR" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 + if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.FAILED == 0 with: issue: ${{ steps.source-run-info.outputs.pullRequestNumber }} message: | :heavy_check_mark: No visual differences introduced by this PR. - [View Playwright Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts) (note: open the "playwright-report" artifact) + + View Playwright Report (note: open the "playwright-report" artifact) - name: "[Comment] Warning: Visual differences introduced by this PR" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 + if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.FAILED != 0 with: issue: ${{ steps.source-run-info.outputs.pullRequestNumber }} message: | - :warning: ${{ steps.playwright.outputs.NUM_FAILED }} visual differences introduced by this PR; please validate if they are desirable. + :warning: Visual differences introduced by this PR; please validate if they are desirable.
Playwright Test Results
             ${{ steps.playwright.outputs.PLAYWRIGHT_OUTPUT }}
             
- [View Playwright Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts) (note: open the "playwright-report" artifact) + + View Playwright Report (note: open the "playwright-report" artifact) -- cgit v1.2.3