Commit 2d59159
Isolate skills client discovery in default-client test (#5417)
TestNewDefaultClient stubbed the TOOLHIVE_API_URL env reader but let
the server-discovery step run against real local state. When a thv or
Desktop server was running, discovery found it and returned its base
URL, so the "falls back to default URL" and "applies options" subtests
saw the discovered URL instead of the default and failed. CI passed
only because no server is running there.
Inject the discovery step into newDefaultClientWithEnv, mirroring the
existing env.Reader injection, and have the subtests stub it. Each
resolution step (env var, discovery, default fallback) is now tested
in isolation, and a new subtest covers the discovered-server path.
Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 50a6c8b commit 2d59159
2 files changed
Lines changed: 43 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | | - | |
| 105 | + | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
636 | 637 | | |
637 | 638 | | |
638 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
639 | 654 | | |
640 | 655 | | |
641 | 656 | | |
642 | 657 | | |
643 | 658 | | |
644 | 659 | | |
645 | | - | |
| 660 | + | |
646 | 661 | | |
647 | 662 | | |
648 | 663 | | |
| |||
652 | 667 | | |
653 | 668 | | |
654 | 669 | | |
655 | | - | |
| 670 | + | |
656 | 671 | | |
657 | 672 | | |
658 | 673 | | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
659 | 687 | | |
660 | 688 | | |
661 | 689 | | |
662 | 690 | | |
663 | 691 | | |
664 | 692 | | |
665 | | - | |
| 693 | + | |
666 | 694 | | |
667 | 695 | | |
668 | 696 | | |
| |||
0 commit comments