Skip to content

Commit f043275

Browse files
committed
fix(gitrepo): address review feedback
Detach runCLIIn's spawned entire binary from any controlling TTY via execx.NonInteractive, matching TestEnv.RunCLIWithError and every other integration helper, so the linked-worktree reftable test can't hang on an interactive prompt path.
1 parent 6fee4d7 commit f043275

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/entire/cli/integration_test/reftable_repo_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
package integration
44

55
import (
6+
"context"
67
"os/exec"
78
"path/filepath"
89
"strings"
910
"testing"
1011

12+
"github.com/entireio/cli/cmd/entire/cli/execx"
1113
"github.com/entireio/cli/cmd/entire/cli/paths"
1214
"github.com/entireio/cli/cmd/entire/cli/testutil"
1315
)
@@ -158,10 +160,12 @@ func TestReftableRepository_LinkedWorktree(t *testing.T) {
158160
}
159161

160162
// runCLIIn runs the built entire binary in an arbitrary directory (e.g. a linked
161-
// worktree) with the same isolated environment RunCLI uses.
163+
// worktree) with the same isolated environment RunCLI uses, detached from any
164+
// controlling TTY (matching TestEnv.RunCLIWithError) so an interactive prompt
165+
// path can't hang the test.
162166
func runCLIIn(t *testing.T, env *TestEnv, dir string, args ...string) string {
163167
t.Helper()
164-
cmd := exec.Command(getTestBinary(), args...) //nolint:noctx // test helper
168+
cmd := execx.NonInteractive(context.Background(), getTestBinary(), args...)
165169
cmd.Dir = dir
166170
cmd.Env = env.cliEnv()
167171
out, err := cmd.CombinedOutput()

0 commit comments

Comments
 (0)