ci(e2e): align PR e2e workflow with ionic-theme-ios27 - #48
Conversation
- Trigger only for PRs to `main`. - Add `deploy-report` concurrency group to serialize gh-pages pushes. - Use `!cancelled()` for `comment-results` and `deploy-report` so cancellation does not try to publish a missing report. - Add `Verify published report URL` step and a marker-based PR comment. - Run `test:e2e:visual` for Ionic 8 to match ios27; add the script. - Raise `timeout-minutes` from 10 to 20 because the current visual diff plus 2 retries exceeds 10 minutes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
| group: playwright-report-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
🟡 PR別のグループでは共有ブランチへのpushが競合する
異なるPRのデプロイやクリーンアップは、同じ gh-pages ブランチへ同時にpushできます。競合した実行は失敗し、対象レポートが更新または削除されません。
Learn more
すべてのレポートは一つの gh-pages ブランチへ書き込まれます。このグループ名にはPR番号が含まれるため、PR #10とPR #11のデプロイは互いを待ちません。cleanup-report は同じブランチへpushしますが、どのconcurrencyグループにも属しません。各実行が別々にチェックアウトしたブランチを公開するため、同時pushでは少なくとも一方が競合して失敗し得ます。
Example: PR #10とPR #11のテストが同時に完了すると、グループ名はそれぞれ playwright-report-10 と playwright-report-11 です。両方が同じ gh-pages の先端から別コミットを作り、後からpushしたジョブが競合します。
Recommended fix: deploy-report と cleanup-report の両方に、PR番号を含まない共通concurrencyグループを設定してください。gh-pages を更新する他のワークフローがある場合も同じグループへ参加させてください。
Was this helpful? React with 👍 or 👎 to provide feedback.
| group: playwright-report-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
🟡 古い実行による最新レポートの上書き
連続pushで新しいテストが先に完了すると、古い実行が後から公開できます。レポートとコメントが現在のPR先端ではなく古い結果へ戻ります。
Learn more
このconcurrency制御はデプロイ開始後にだけ適用され、同じPRの古いテスト実行をキャンセルしません。cancel-in-progress: false なので、古い実行もグループを取得できれば必ず公開を試みます。テスト完了順はコミット順と一致しないため、古い成果物が最新成果物の後に公開されます。コメント本文もその古いworkflow runへのリンクで更新されます。
Example: コミットAのテスト中にコミットBをpushし、Bのテストが先に終わるとBのレポートが公開されます。その後Aが終わるとAのレポートと実行リンクで上書きされますが、PRの先端はBのままです。
Recommended fix: PR単位で古いworkflow run全体をキャンセルするか、公開直前に実行対象SHAが現在のPR head SHAと一致することを確認してください。共有ブランチのpush直列化とは別に、古い成果物を公開しない仕組みが必要です。
Was this helpful? React with 👍 or 👎 to provide feedback.
| - name: Verify published report URL | ||
| env: | ||
| REPORT_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-${{ github.event.pull_request.number }}/ | ||
| run: curl --fail --silent --show-error --location --retry 6 --retry-delay 10 --retry-all-errors --max-time 20 --output /dev/null "$REPORT_URL" |
There was a problem hiding this comment.
🟡 失敗した公開確認の後にもレポートリンクが投稿される
URL確認が失敗しても、後続コメントは always() により実行されます。未公開または到達不能なレポートへのリンクがPRへ投稿されます。
Learn more
このステップはcurlの終了コードで公開URLを検証します。しかし、直後のコメントステップには if: always() があるため、このステップが失敗してもコメント処理が実行されます。その結果、追加した検証はジョブを失敗させるだけで、リンク投稿を止めません。
Example: Pagesの反映が全リトライ後も404ならcurlは失敗します。それでもコメントは作成または更新され、利用者には404のURLが案内されます。
Recommended fix: コメントステップを検証成功時だけ実行してください。例えば検証ステップへIDを付けて成功を条件にするか、コメントステップの if: always() を通常の成功条件へ変更します。デプロイ失敗時にも既存コメントを整理したい場合は、成功用と失敗用の処理を分けてください。
Was this helpful? React with 👍 or 👎 to provide feedback.
| run: | | ||
| if [ "${{ matrix.ionic-major }}" = "8" ]; then | ||
| PLAYWRIGHT_JSON_OUTPUT_NAME=e2e/screenshot.spec.ts-ionic8.json npm run test:e2e:visual -- --reporter=json,html | ||
| else | ||
| PLAYWRIGHT_JSON_OUTPUT_NAME=e2e/screenshot.spec.ts-ionic9.json npm run test:e2e -- --reporter=json,html | ||
| fi |
There was a problem hiding this comment.
🔍 Ionic 8のRTL回帰テストが対象外になる
Ionic 8は視覚テストだけを実行するため、RTL回帰テスト はIonic 9限定になります。このカバレッジ縮小が意図どおりか確認してください。
Was this helpful? React with 👍 or 👎 to provide feedback.
| # ios27 uses 10, but this PR's large visual diff + 2 retries exceeds that. | ||
| timeout-minutes: 20 |
Playwright test resultsDetails
|
|
📊 Ionic 9 Playwright Test Report View the detailed Ionic 9 report: https://rdlabo-dev.github.io/ionic-theme-md3/pr-48/ Ionic 8 runs against the same screenshots in a separate matrix job. View both results in the workflow run. |
Summary
main.deploy-reportconcurrency group to serializegh-pagespushes.!cancelled()fordeploy-reportandcomment-resultsso cancellation does not try to publish/download missing artifacts.test:e2e:visualfor Ionic 8 and add thetest:e2e:visualdemo script.timeout-minutesfrom 10 to 20 to avoid timing out on large visual diffs with 2 retries.This is a workflow-only change; it does not touch theme code.
Test plan
mainuse this workflow and reachdeploy-report.https://<owner>.github.io/ionic-theme-md3/pr-<n>/is published after the E2E job.Generated with Devin