From 267b4ff11928d832102dd0a510a449509e183b2e Mon Sep 17 00:00:00 2001 From: "Raymond W. Ko" Date: Thu, 15 Oct 2026 16:04:18 -0400 Subject: [PATCH] test: isolate Dolt credentials and agent settings in the test env beads_test_env_enter and its Bazel mirror tools/bazel/test_env.sh already unset the BEADS_DOLT_* connection variables, but not the server user and password, nor BD_AGENT_MODE, BD_NON_INTERACTIVE and BEADS_MAIL_DELEGATE. A test run from a shell configured for a shared Dolt server or for agent use inherited them: with BEADS_DOLT_SERVER_USER set, TestDoltServerMode and TestDoltServerModeRoundtrip in internal/configfile fail because the env value overrides the user the test configured. Unset all five in both wrappers so the lists stay in step. Co-Authored-By: Claude Opus 5.5 Agent-Signature: claude-code-claude-fable-5-1-high on behalf of Raymond W. Ko --- scripts/ci/lib/test-env.sh | 7 +++++++ tools/bazel/test_env.sh | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/ci/lib/test-env.sh b/scripts/ci/lib/test-env.sh index d1a4cde27..90eee885d 100644 --- a/scripts/ci/lib/test-env.sh +++ b/scripts/ci/lib/test-env.sh @@ -73,6 +73,13 @@ beads_test_env_enter() { unset BEADS_DOLT_SERVER_DATABASE unset BEADS_DOLT_SERVER_SOCKET unset BEADS_DOLT_PASSWORD + # A shell pointed at a shared Dolt server, or running bd in agent mode, + # must not hand its credentials or agent settings to the tests. + unset BEADS_DOLT_SERVER_USER + unset BEADS_DOLT_SERVER_PASSWORD + unset BD_AGENT_MODE + unset BD_NON_INTERACTIVE + unset BEADS_MAIL_DELEGATE # bazeltest debug override: never let an exported value point source-scan # guards at another checkout. unset BEADS_TEST_REPO_ROOT diff --git a/tools/bazel/test_env.sh b/tools/bazel/test_env.sh index dbaaecd1c..3e647d414 100755 --- a/tools/bazel/test_env.sh +++ b/tools/bazel/test_env.sh @@ -114,7 +114,9 @@ unset BEADS_DIR BEADS_DB BD_DB BD_JSON BD_NO_DB BD_NO_DAEMON BD_ACTOR \ BEADS_ACTOR GT_ROOT BEADS_DOLT_SHARED_SERVER BEADS_DOLT_SERVER_MODE \ BEADS_DOLT_AUTO_START BEADS_DOLT_SERVER_HOST BEADS_DOLT_SERVER_PORT \ BEADS_DOLT_PORT BEADS_DOLT_SERVER_DATABASE BEADS_DOLT_SERVER_SOCKET \ - BEADS_DOLT_PASSWORD BEADS_TEST_REPO_ROOT BEADS_DOLT_BIN + BEADS_DOLT_PASSWORD BEADS_TEST_REPO_ROOT BEADS_DOLT_BIN \ + BEADS_DOLT_SERVER_USER BEADS_DOLT_SERVER_PASSWORD BD_AGENT_MODE \ + BD_NON_INTERACTIVE BEADS_MAIL_DELEGATE # Hermetic host tools: the pinned Dolt CLI (tools/bazel/dolt.bzl) goes first on # PATH, so no test runs whatever dolt the executor happens to have, or skips