You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aa19e68
Browse filesBrowse the repository at this point in the historyBrowse files
perf(tests): drop the executable tool registry and full block map from non-sweep tests
The vitest suite is bounded by module loading, and the biggest single cost is a
test file opting out of the global `@/tools/registry` or `@/blocks/registry`
mock. Trim that where the test never needed the whole thing:
- `lib/internal/tool-operations/registry.server.test.ts` checked registration
against `getToolIds()` but still imported the executable registry for one
sweep. That sweep — every operation-backed tool has no `request` and a
registered handler — is the in-process half of the transport partition, so
it moves next to the external-URL sweep in `tools/request-transport.test.ts`,
which already pays for the registry. Handler loads now run in parallel.
Collect 12.5s -> 0.1s, run 6s -> 4.3s; request-transport unchanged (~8s).
- New `partialBlockRegistry` in `@sim/testing/mocks/block-registry.mock`
builds the `@/blocks/registry-maps` shape from the block modules a test
actually reads, so the real registry code runs over those blocks alone.
Applied to the six non-sweep tests that unmocked the block registry for one
or two blocks (webhook, slack, whatsapp, condition/function,
knowledge/start_trigger): collect 3-8s -> 0.05-2s each. Registry sweeps
keep the real map.
- `tools/index.test.ts` retry cases set `retryDelayMs: 0`, which the retry
config replaces with the 500ms default; `1` is the smallest delay honored.
Run 4.0s -> 0.45s.
- `tools/metadata.test.ts` collects sweep offenders into one assertion instead
of one `expect` per registry entry, and indexes ids once. Run 1.1s -> 0.03s.
- The `vi.unmock('@/tools/registry')` in the search-replace tests was dead:
nothing in their graph imports the registry any more, and all 106 tests pass
without it, contrary to the comment that claimed eight would fail.
0 commit comments