aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-04-02 21:56:55 +0900
committerDarius Jahandarie <djahandarie@gmail.com>2023-04-02 21:59:49 +0900
commitd89a32acd4ddb0fa536f00798a7e43ef6c17092b (patch)
tree95d5d867ee890ebc9a107113823dd3877bda6ad2
parentddbbc76a8859d520ce1719e92a739b991e5b8854 (diff)
Make playwright_comment work even when there are retries / flaky tests
-rw-r--r--.github/workflows/playwright_comment.yml14
1 files changed, 8 insertions, 6 deletions
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)
+
+ <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts">View Playwright Report</a> (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.
<details>
<summary>Playwright Test Results</summary>
<pre>
${{ steps.playwright.outputs.PLAYWRIGHT_OUTPUT }}
</pre>
</details>
- [View Playwright Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts) (note: open the "playwright-report" artifact)
+
+ <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts">View Playwright Report</a> (note: open the "playwright-report" artifact)