Repository navigation
fix: unit tests run per package in CI; error envelope keeps userMessage (CL-8150) - #792
Merged
Merged
Conversation
Running bun test from the repo root drops each workspace package's own bunfig.toml (DOM preloads for jsdom/happy-dom, etc.), producing hundreds of false failures. bun run test already fans out per package via scripts/run-all.ts, so point the unit job at it instead so CI matches what a contributor runs locally.
isBlockingOverlayOpen defaulted its parameter to the document global, which is only safe where a DOM global already exists at call time. Read globalThis.document lazily inside the function body instead so the module itself never assumes a DOM is present.
Running the suite per package (previous commit) surfaced tests that had drifted from real source: hardcoded tool-package name/version literals left over from the memory-tools -> memory and web-search-tools/ tools-skills version bumps, a scout-agent pin self-reference, a publish-tools fixture still naming the retired capability-tools predecessor, and an inbox mailbox-thread fixture missing the body field @corbits/mailbox's schema now requires. scout-agent's package.json bumps to 0.0.6 since its src/definition.test.ts changed.
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.
Summary
unitjob ranbun test apps packages workflows scriptsfrom the repo root, which drops each workspace package's ownbunfig.toml(DOM preloads, etc.) and produces hundreds of false failures. Points it atbun run testinstead, which already fans out per package viascripts/run-all.ts(same as localbun run check).packages/context-menu/src/dialog-guard.ts:isBlockingOverlayOpendefaulted its parameter to the baredocumentglobal; now resolved lazily viaglobalThis.documentinside the function body.packages/error-sink'smakeErrorEnvelopewas already correct onmain— no bug found there; its test and the onboarding/chat/webhook-triggers/workflows-authoring suites all pass.@corbits/memory-tools->@corbits/memory,@corbits/web-search-tools0.0.3 -> 0.0.4,@corbits/tools-skills0.0.3 -> 0.0.4, a stalepublish-toolsfixture still naming the retired@corbits/capability-toolspredecessor as@corbits/memory-tools), and an@corbits/inboxmailbox-thread test fixture missing thebodyfield@corbits/mailbox's schema now requires.packages/scout-agentbumped to0.0.6since itssrc/definition.test.tschanged (required by the tool-package-freshness check).Deleted tests
None — every red test was a fixable drift (stale literal/fixture), not obsolete coverage, so nothing was deleted.
Test plan
bun run typecheckbun run lint && bun run fmt:checkbun run check:structuralbun run test(per-package, matches CI) — green, run repeatedly to rule out the flakiness some tests show under heavy parallel load