Commit 9c468de
fix(test): make the suite pass from any checkout directory (#199)
Two defects made a bare `npm test` unreliable outside a checkout literally
named mcp-automem — the reason the marker-extraction work had to be run as
`npx vitest run --exclude '**/.claude/**'` and still reported two failures.
vitest.config.ts: setting `exclude` replaces vitest's defaults, so the list has
to carry everything. It named 'node_modules/**' and 'dist/**' without the
recursive '**/' form and said nothing about .claude/, so from the main checkout
the glob walked every agent worktree under .claude/worktrees/ — 106 test files
across two worktrees here — running each suite twice, the second time from a
stale copy of the repo.
hermes-real-host.test.ts: the provider derives its project tag from
`basename(os.getcwd())`, and runHermesProviderPrefetchSequence defaulted its cwd
to REPO_ROOT. The tag assertions therefore passed only where the checkout
directory happened to be named mcp-automem, and failed in a worktree, a second
clone, or any CI cache path. The prefetch now runs in a fixture directory named
for the slug, which pins the contract the provider actually promises instead of
the machine's directory layout. Python imports resolve from the Hermes venv, not
cwd, so nothing else depended on REPO_ROOT here.
Both verified load-bearing: dropping the .claude exclude re-globs a planted
worktree fixture, and restoring the REPO_ROOT default fails exactly the two
prefetch tests.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 2d1716f commit 9c468de
2 files changed
Lines changed: 42 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
325 | 339 | | |
326 | 340 | | |
327 | 341 | | |
328 | | - | |
| 342 | + | |
329 | 343 | | |
330 | 344 | | |
331 | 345 | | |
| |||
481 | 495 | | |
482 | 496 | | |
483 | 497 | | |
| 498 | + | |
| 499 | + | |
484 | 500 | | |
485 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
486 | 507 | | |
487 | 508 | | |
488 | 509 | | |
489 | 510 | | |
490 | 511 | | |
| 512 | + | |
491 | 513 | | |
492 | 514 | | |
493 | 515 | | |
| |||
637 | 659 | | |
638 | 660 | | |
639 | 661 | | |
640 | | - | |
| 662 | + | |
641 | 663 | | |
642 | 664 | | |
643 | 665 | | |
| |||
699 | 721 | | |
700 | 722 | | |
701 | 723 | | |
702 | | - | |
| 724 | + | |
| 725 | + | |
703 | 726 | | |
704 | 727 | | |
705 | 728 | | |
| |||
708 | 731 | | |
709 | 732 | | |
710 | 733 | | |
711 | | - | |
| 734 | + | |
712 | 735 | | |
713 | 736 | | |
714 | | - | |
| 737 | + | |
715 | 738 | | |
716 | 739 | | |
717 | 740 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
12 | 23 | | |
| |||
0 commit comments