Skip to content

fix: unit tests run per package in CI; error envelope keeps userMessage (CL-8150) - #792

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-8150-unit-green
Sep 17, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-8150-unit-green

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • CI's unit job ran bun test apps packages workflows scripts from the repo root, which drops each workspace package's own bunfig.toml (DOM preloads, etc.) and produces hundreds of false failures. Points it at bun run test instead, which already fans out per package via scripts/run-all.ts (same as local bun run check).
  • packages/context-menu/src/dialog-guard.ts: isBlockingOverlayOpen defaulted its parameter to the bare document global; now resolved lazily via globalThis.document inside the function body.
  • packages/error-sink's makeErrorEnvelope was already correct on main — no bug found there; its test and the onboarding/chat/webhook-triggers/workflows-authoring suites all pass.
  • Fixed test drift surfaced by running the suite per package: hardcoded tool-package name/version pin literals left over from renames/version bumps (@corbits/memory-tools -> @corbits/memory, @corbits/web-search-tools 0.0.3 -> 0.0.4, @corbits/tools-skills 0.0.3 -> 0.0.4, a stale publish-tools fixture still naming the retired @corbits/capability-tools predecessor as @corbits/memory-tools), and an @corbits/inbox mailbox-thread test fixture missing the body field @corbits/mailbox's schema now requires.
  • packages/scout-agent bumped to 0.0.6 since its src/definition.test.ts changed (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 typecheck
  • bun run lint && bun run fmt:check
  • bun run check:structural
  • bun run test (per-package, matches CI) — green, run repeatedly to rule out the flakiness some tests show under heavy parallel load

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.
@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

CL-8150

@TheGreatAxios
TheGreatAxios merged commit dc67085 into main Sep 17, 2026
1 check passed
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.

1 participant