Repository navigation
test: restore real secureStorage exports after githubModelsCredentials hydrate tests (TA-001 round 2) - #2338
Conversation
…s hydrate tests (TA-001 round 2)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
jatmn
left a comment
There was a problem hiding this comment.
— jatmn's PR Review agent
🟢 Thanks for the contribution. I do not see any actionable issues from my review.
Merge readiness
The PR description still lists full no---isolate randomized shard runs as "in progress" while typecheck, bun run check, and the focused hydrate + ProviderManager pair are marked done. CI exercises tests with per-shard --isolate (see scripts/run-tests.ts), so merge is not blocked, but updating the body with the finished randomized-run results (or noting that local verification used the pairwise and seed-2027 commands) would close the evidence gap for maintainers tracking TA-001 round 2.
Branch is current with main (merge-base equals live base; mergeable_state: clean). Required checks on head 4afc9036623dcb37d0ec88eefa7e644f2fcac79c are green, including typecheck, smoke, dedicated tests, all eight unit-test shards, launcher compatibility, CodeQL, and pr-intent-scan.
Summary
src/utils/githubModelsCredentials.hydrate.test.ts.mock.module('./secureStorage/index.js', ...)with a factory that returns onlyread.mock.restore()inafterEachdoes not undomock.moduleregistrations, so the last stub stayed registered for the rest of the process. Whensrc/components/ProviderManager.test.tsxran later in the same process (for examplebun test --randomize --seed=2027without--isolate),getXaiSecureStorage().readAsyncwas undefined and 74 of its 76 tests failed withTypeError: getXaiSecureStorage().readAsync is not a function.secureStorageexports from a cache-busted import (?real=<nonce>), and re-register that copy inafterAll. This is the same pattern earlier TA-001 slices used.snapshotEnv, as CONTRIBUTING asks. The snapshot is taken after the shared mutation lock is acquired and restored before it is released. The same six variables are covered and none are cleared, so env behavior is unchanged.Impact
--isolateruns.--isolatestays in CI.Testing
bun run typecheck: pass.bun run check: pass.bun test ./src/utils/githubModelsCredentials.hydrate.test.ts ./src/components/ProviderManager.test.tsx: 79 pass, 0 fail (before the fix: 74 ProviderManager failures).bun test ./src/utils/githubModelsCredentials.hydrate.test.ts: 3 pass.--isolateruns (8 native shards plus--randomizeseeds 2027, 101 and 6001): in progress, results will be added here.Notes
Summary by CodeRabbit