test(windows): isolate multi-ID update subprocess home (mybd-n5gg) (#4950)

Agent-Signature: codex-gpt-5.6-sol-high on behalf of matt wilkie
This commit is contained in:
matt wilkie 2026-07-22 21:19:43 -07:00 • committed by GitHub
commit 7953ba438f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,8 +28,8 @@ import (
)
// multiIDUpdateEnv returns a hermetic environment for bd subprocess runs:
// no inherited BEADS_* variables, HOME pinned to the test dir, metrics and
// daemons disabled.
// no inherited BEADS_* variables, HOME and USERPROFILE pinned to the test dir,
// metrics and daemons disabled.
func multiIDUpdateEnv(dir string) []string {
var env []string
for _, e := range os.Environ() {
@ -40,6 +40,7 @@ func multiIDUpdateEnv(dir string) []string {
}
return append(env,
"HOME="+dir,
"USERPROFILE="+dir,
"BD_NON_INTERACTIVE=1",
"BD_DISABLE_METRICS=1",
"BD_DISABLE_EVENT_FLUSH=1",
@ -75,6 +76,8 @@ func setupMultiIDUpdateDB(t *testing.T) (bd, dir string) {
t.Helper()
bd = buildBDForInitTests(t)
dir = t.TempDir()
runGitForBootstrapTest(t, dir, "init", "-q")
runGitForBootstrapTest(t, dir, "config", "core.hooksPath", ".git/hooks")
stdout, stderr, code := runBDMultiID(t, bd, dir,
"init", "--prefix", "test", "--quiet", "--non-interactive", "--skip-hooks", "--skip-agents")
if code != 0 {