Skip to content

Fix CI: update actions, mocha and the UI test image - #281

Open
SmartManoj wants to merge 1 commit into
nohello-net:mainfrom
SmartManoj:fix-ci
Open

SmartManoj wants to merge 1 commit into
nohello-net:mainfrom
SmartManoj:fix-ci

Conversation

@SmartManoj

Copy link
Copy Markdown

CI fails on every PR before any test runs. I ran the current ci.yml on my fork (run):

  • ui-test: This request has been automatically failed because it uses a deprecated version of actions/upload-artifact: v2.
  • unit-test, lint, typecheck: actions/setup-node@v2 fails with Cache service responded with 400.

With those fixed, three more problems showed up:

  1. yarn test:unit fails on current Node. From Node 22.18, Node's own type stripping takes over the .ts specs (Cannot use import statement outside a module). On Node 26 (the current lts/* in .nvmrc), mocha 9 cannot even load yargs 16 (require is not defined in ES module scope).
  2. On Node 26, npx playwright install from 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.
  3. The full-page snapshot shows the current year, so the committed 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-test runs in mcr.microsoft.com/playwright:v1.20.1-focal. That image already has the Chromium build for @playwright/test 1.20.1, its system dependencies and the fonts. So the playwright install step is gone, and the environment is the same in every run. yarn check-snapshots and yarn update-snapshots use 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.png still matches.

Testing

On my fork, this branch plus a temporary push trigger:

I did not run the act-based yarn check-snapshots / yarn update-snapshots locally.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 06:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants