fix: preserve adaptive tab baselines in screenshot updates - #227
Conversation
| const directories = fs.readdirSync(artifactDirectory).sort(); | ||
| if (directories.join('\n') !== [...snapshotDirectories].sort().join('\n')) { | ||
| core.setFailed('The screenshot artifact contains missing or unexpected directories.'); | ||
| return; |
There was a problem hiding this comment.
🔴 iOS 26 向け PR のスクリーンショット更新が失敗する
ios26 向け PR では、対象ブランチの更新スクリプトが通常の画像だけを生成します。adaptive-tab のディレクトリも必須とするため、iOS 26 の画像をコミットできません。
Learn more
このワークフローは main と ios26 の PR を受け付け、PR の対象ブランチから更新手順を読み込みます(更新手順の選択、スクリプトの実行)。ios26 ブランチの更新手順は screenshot.spec.ts だけを実行し、同ブランチには adaptive-tab-bar.spec.ts がありません。そのため、通常の ios26 PR の成果物には通常の画像ディレクトリしか含まれません。新しい検証が成果物内に両方のディレクトリを要求するので、更新後のコミット処理が必ず失敗します。
Example: ios26 を対象とし、通常のスクリーンショットだけを持つ PR で /update-screenshots を実行すると、更新手順は成功しても成果物には screenshot.spec.ts-snapshots しかありません。コミット処理は「missing or unexpected directories」で終了します。
Recommended fix: PR の対象ブランチで実行するテストと一致するディレクトリだけを必須にしてください。削除対象も、その実行で生成したディレクトリに限定してください。
Was this helpful? React with 👍 or 👎 to provide feedback.
Playwright test resultsDetails
Flaky testschromium › range-interaction.spec.ts › dual thumbs remain within their resting width at 100 in ltr |
|
📊 Ionic 9 Playwright Test Report View the detailed Ionic 9 report: https://rdlabo-dev.github.io/ionic-theme-ios27/pr-227/ Ionic 8 runs against the same screenshots in a separate matrix job. View both results in the workflow run. |
npm beta publishedCI passed for the merge commit npm install @rdlabo/ionic-theme-ios27@1.2.0-beta.pr227.shad6de94b0c337 |
For PRs targeting
main, the screenshot updater runs bothscreenshot.spec.tsandadaptive-tab-bar.spec.ts, but only uploads and commits the first suite's snapshots. Adaptive tab baselines therefore remain stale after/update-screenshots.Include both snapshot directories in the artifact and preserve their relative paths when committing. Require and manage both directories for
main, and onlyscreenshot.spec.ts-snapshotsforios26, matching each base branch's update script. Reject missing or unexpected artifacts, and restrict stale-file deletion to the directories regenerated for that base branch.Validation: YAML parsing, formatting, and
git diff --checkpassed. Seven mocked executions of the workflow's commit script verified successfulmainandios26updates, scoped deletions, and rejection of missing, extra, empty, or invalid artifact contents. Theios26case reproduced the reported failure before the fix.This PR changes only the screenshot update workflow; the vertical tab feature and its baselines are in #226.