Repository navigation
fix(test): Control UI tests fail on non-US-English host locales - #161899
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 10:23 PM ET / October 7, 2026, 02:23 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR pins root Vitest test-process locales to C.UTF-8 and updates runner regression coverage so host locales cannot change expected currency and date output. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. The focused patch and supplied before/after locale results support readiness, with no actionable correctness findings or additional contributor blocker. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s root test runners turn developer and CI commands into test child processes. Their startup environment determines the default locale used by Control UI formatting tests. flowchart LR
A[Developer or CI command] --> B[Root test runner]
B --> C[Shared child environment]
C --> D[Fixed test locale]
D --> E[Vitest child process]
E --> F[Formatting assertions]
F --> G[Test results]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +5, Other +6. Total +11 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep locale normalization in the shared root-runner environment owner while preserving explicit-locale tests and browser-dependent application formatting. Do we have a high-confidence way to reproduce the issue? Yes. Source confirms current main inherits the host locale, and the linked issue plus supplied baseline/candidate runs identify concrete formatting failures through the root runner; this review did not execute tests. Is this the best way to solve the issue? Yes. Normalizing the environment before child startup fixes the shared root entry point, matches existing isolation practice, and avoids changing correct application formatting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2ba33cb84999. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
# Conflicts: # test/scripts/run-vitest.test.ts
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(test): Control UI tests fail on non-US-English host locales This is item 1/1 in the current shard. Shard 0/1. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
…claw#161899) Pin the locale for root vitest child processes so local node scripts/run-vitest.mjs and pnpm test runs match CI on any host locale instead of reporting false Control UI failures under locales such as de_DE or ja_JP. Closes openclaw#161898. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #161898
What Problem This Solves
Control UI tests inherit the developer's default locale, although their currency/date assertions expect US-English output. This produces false failures on non-US-English machines.
User Impact
Test-runner only: pin
LANGandLC_ALLtoC.UTF-8before root Vitest child processes start, matching CI and the existing isolated runner. Production formatting is unchanged. Thanks to @DonnieFi for reporting, reproducing, and implementing the fix.This intentionally overrides shell
LANG/LC_ALLfor root test runs. Locale-specific suites still choose their own locale explicitly: the Control UI formatting and wizard locale-selection suites pass under a German parent environment. No test relying on an inherited non-English locale was found. The directpnpm --dir ui testentry point remains outside this root-runner change.Evidence
Integrated main
2ae568e850a67b2b1d79c778c4cd833f129ae805because the runner tests had materially changed; retained the contributor commits and ported the regression into the current table-driven test.Secretless Linux Docker, Node 24.16.0, generated locales, all six issue-listed files through
node scripts/run-vitest.mjs run(83 tests on this base). The baseline restores the exact main environment owner; all other source and UI tests are identical:de_DE.UTF-8ja_JP.UTF-8en_US.UTF-8C.UTF-8Both English controls are unchanged. The parent Node process independently reported
de-DE/ja-JP, so the failing controls did not silently fall back to English. Representative baseline failures include1. Mai 2026/2026年5月1日versusMay 1, 2026, and localized provider currencies.tsgoscripts typecheck passed (47.1 s wall).ui/src/lib/format.test.tsandsrc/wizard/i18n/index.test.tspass underde_DE.UTF-8.vitest-worker-artifactshit the same existinguncertain outputcompiler-lifetime assertion on candidate and revert baseline (liveversusindeterminate); a focused candidate run passed. This process-lifetime assertion is outside the locale change; it is not claimed fixed.run-vitestandci-run-node-test-shardsuites pass: 334 tests, 38.3 s combined wall with--maxWorkers=1(36.6 s Vitest duration). The added locale table row is in-process; the existing shard/process scenarios account for the suite cost.scripts/github/real-behavior-proof-check.mjsagainst the public PR payload without credentials: exit 0, “External PR includes problem context and evidence.” No cancelled selected test lists were omitted.No overlap with Pash/Sarah changes.