Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2d5de8

Browse files
committed
fixup! fixup! fixup! allow paralleltest
1 parent1d937a0 commite2d5de8

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

‎agent/agentcontainers/devcontainercli_test.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,9 @@ func TestDevcontainerCLI_ArgsAndParsing(t *testing.T) {
109109

110110
testExecer:=&testDevcontainerExecer{
111111
testExePath:testExePath,
112-
extraEnv: []string{
113-
"TEST_DEVCONTAINER_WANT_ARGS="+tt.wantArgs,
114-
"TEST_DEVCONTAINER_WANT_ERROR="+fmt.Sprintf("%v",tt.wantError),
115-
"TEST_DEVCONTAINER_LOG_FILE="+filepath.Join("testdata","devcontainercli","parse",tt.logFile),
116-
},
112+
wantArgs:tt.wantArgs,
113+
wantError:tt.wantError,
114+
outputFile:filepath.Join("testdata","devcontainercli","parse",tt.logFile),
117115
}
118116

119117
dccli:=agentcontainers.NewDevcontainerCLI(logger,testExecer)
@@ -133,7 +131,9 @@ func TestDevcontainerCLI_ArgsAndParsing(t *testing.T) {
133131
// testDevcontainerExecer implements the agentexec.Execer interface for testing.
134132
typetestDevcontainerExecerstruct {
135133
testExePathstring
136-
extraEnv []string
134+
wantArgsstring
135+
wantErrorbool
136+
outputFilestring
137137
}
138138

139139
// CommandContext returns a test binary command that simulates devcontainer responses.
@@ -155,9 +155,13 @@ func (e *testDevcontainerExecer) CommandContext(ctx context.Context, name string
155155

156156
//nolint:gosec // This is a test binary, so we don't need to worry about command injection.
157157
cmd:=exec.CommandContext(ctx,e.testExePath,testArgs...)
158-
cmd.Env=append(os.Environ(),e.extraEnv...)
159-
// Set this environment va[riable so the child process knows it's the helper.
160-
cmd.Env=append(cmd.Env,"TEST_DEVCONTAINER_WANT_HELPER_PROCESS=1")
158+
// Set this environment variable so the child process knows it's the helper.
159+
cmd.Env=append(os.Environ(),
160+
"TEST_DEVCONTAINER_WANT_HELPER_PROCESS=1",
161+
"TEST_DEVCONTAINER_WANT_ARGS="+e.wantArgs,
162+
"TEST_DEVCONTAINER_WANT_ERROR="+fmt.Sprintf("%v",e.wantError),
163+
"TEST_DEVCONTAINER_LOG_FILE="+e.outputFile,
164+
)
161165

162166
returncmd
163167
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp