Files
magpie/internal/plugin
yetone 75ab21af4d plugin: a test binary takes no Bun from PATH (#6761, #6764)
TestRemoveListedAccountLeavesHiddenNamesake went red in every
whole-package run of internal/provider since 30de93e9e, on CI (ubuntu,
e99307fb8) and on mote, and passed alone.

The cause: 30de93e9e falls back on a Bun from PATH (or ~/.bun/bin) when
the download fails. A test's sandbox has no Bun, and testenv refuses the
download, so TestPluginEmptyKeyKeyAsked now copied the developer's or
CI's own Bun in and started a real plugin host, which nothing ended.
plugin.SignOut goes to the running host when there is one, so the later
test's ForgetLogin signed out in that host's HOME and its own
plugin-auth.json kept zcode#l47q19. Logging plugin.Running() in the test
showed true; the log shows "running plugins on Bun 1.4.2 from
~/.bun/bin/bun" in TestPluginEmptyKeyKeyAsked just before.

Now pathBuns is empty in a test binary testenv isolated
(MAGPIE_TEST_SANDBOX), as before 30de93e9e every test that asks a plugin
without MAGPIE_BUN got no host. TestBunOnPathAfterDownloadFailed sets
pathBuns itself, and BunReleaseForTest already emptied it. A real magpie
never has the marker.

Run on mote:
- before (9bcdcfb7d): go test ./internal/provider -count=1, red 2 of 2
  with "the account removed is still signed in" and running=true;
- after: go vet ./internal/plugin; go test ./internal/provider
  ./internal/plugin -count=1: ok (155s, 173s); gofmt -l clean.

Not run: the full ./... suite, and Windows/Linux; the change is one
early return under a test-only variable.
2026-11-15 22:38:49 +08:00
..
…