Repository navigation
Fix CI: update actions, mocha and the UI test image - #281
Open
SmartManoj wants to merge 1 commit into
Open
SmartManoj wants to merge 1 commit into
SmartManoj wants to merge 1 commit into
Conversation
Every CI run fails before a test runs. On a fork, the current workflow fails with: - ui-test: "uses a deprecated version of `actions/upload-artifact: v2`" - the other jobs: setup-node@v2 "Cache service responded with 400" Changes: - actions/checkout, setup-node and upload-artifact: v2 -> v7. - mocha 9 -> 12. On current Node, mocha 9 fails: from Node 22.18, Node's own type stripping takes over the .ts specs, and on Node 26 (the current lts/*) mocha 9 cannot load yargs 16. mocha 12 runs the specs on Node 24 and 26 with no flags. - ui-test runs in mcr.microsoft.com/playwright:v1.20.1-focal, which has the Chromium build for @playwright/test 1.20.1. On Node 26, `playwright install` from 1.20.1 exits with code 0 before it unzips the browser, so that step is removed. `yarn check-snapshots` and `yarn update-snapshots` use the same image. - The snapshot test pins the year on the page to 2022, so the snapshot does not break every 1 January. - index-linux.png is refreshed in the new image. It differs from the 2022 file only in font fallback (the check-mark list markers and the RTL language names in the footer). why-linux.png still matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the CI and snapshot-testing updates.
No open issues 🎉
What changed in this PR
This PR addresses CI startup failures and stabilizes UI snapshot testing by updating CI actions and Mocha, aligning browser environments, and removing year-dependent screenshot differences.
Changes:
- Upgrade CI actions to v7 and Mocha to ^12.0.3, with corresponding lockfile updates.
- Use the Playwright v1.20.1-focal image for CI and local snapshot commands, removing redundant browser installation steps.
- Normalize the displayed year to 2022 before taking index snapshots.
| File | Description |
|---|---|
yarn.lock |
Update Mocha and its dependency tree. |
test/ui/snapshot.spec.ts |
Normalize year text before capturing snapshots. |
package.json |
Upgrade Mocha and align local snapshot commands with the CI image. |
.github/workflows/ci.yml |
Update actions and run UI tests in the matching Playwright container. |
.github/local-workflows/snapshots.yml |
Remove browser installation steps now covered by the image. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI fails on every PR before any test runs. I ran the current
ci.ymlon my fork (run):ui-test: This request has been automatically failed because it uses a deprecated version ofactions/upload-artifact: v2.unit-test,lint,typecheck:actions/setup-node@v2fails with Cache service responded with 400.With those fixed, three more problems showed up:
yarn test:unitfails on current Node. From Node 22.18, Node's own type stripping takes over the.tsspecs (Cannot use import statement outside a module). On Node 26 (the currentlts/*in.nvmrc), mocha 9 cannot even load yargs 16 (require is not defined in ES module scope).npx playwright installfrom Playwright 1.20.1 downloads Chromium, then exits with code 0 before it unzips it. The tests then fail with Executable doesn't exist at /ms-playwright/chromium-978106/chrome-linux/chrome.index-linux.png(2022) cannot match.Changes
actions/checkout,actions/setup-node,actions/upload-artifact: v2 → v7.mocha: ^9.2.2 → ^12.0.3. The unit tests pass on Node 24 and 26 with no flags.ui-testruns inmcr.microsoft.com/playwright:v1.20.1-focal. That image already has the Chromium build for@playwright/test1.20.1, its system dependencies and the fonts. So theplaywright installstep is gone, and the environment is the same in every run.yarn check-snapshotsandyarn update-snapshotsuse the same image.test/ui/snapshot.spec.ts: before the screenshots, the test replaces the current year on the page with 2022. Without this, the snapshot breaks every 1 January.index-linux.png: refreshed in the new image. It differs from the 2022 file only in font fallback (the ✓ list markers and the RTL language names in the footer).why-linux.pngstill matches.Testing
On my fork, this branch plus a temporary push trigger:
I did not run the act-based
yarn check-snapshots/yarn update-snapshotslocally.🤖 Generated with Claude Code