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

Commit72ff312

Browse files
committed
lint
1 parent8eb3ebe commit72ff312

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

‎integration/integration_test.go

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import (
1414
"time"
1515

1616
"github.com/coder/coder/v2/codersdk"
17-
"github.com/docker/docker/api/types"
1817
"github.com/docker/docker/api/types/container"
1918
"github.com/docker/docker/client"
20-
"github.com/docker/docker/pkg/stdcopy"
2119
"github.com/docker/go-connections/nat"
2220
"github.com/stretchr/testify/assert"
2321
"github.com/stretchr/testify/require"
@@ -27,7 +25,7 @@ import (
2725
// For each directory containing a `main.tf` under `/integration`, performs the following:
2826
// - Creates a temporary Coder instance running in Docker
2927
// - Runs the `main.tf` specified in the given test directory against the Coder deployment
30-
// - Asserts the state of the deployment via `codersdk`
28+
// - Asserts the state of the deployment via `codersdk`.
3129
funcTestIntegration(t*testing.T) {
3230
ifos.Getenv("TF_ACC")=="1" {
3331
t.Skip("Skipping integration tests during tf acceptance tests")
@@ -190,34 +188,6 @@ func startCoder(ctx context.Context, t *testing.T, name string) *codersdk.Client
190188
returnclient
191189
}
192190

193-
// execContainer executes the given command in the given container and returns
194-
// the output and the exit code of the command.
195-
funcexecContainer(ctx context.Context,t testing.TB,containerID,commandstring) (string,int) {
196-
t.Helper()
197-
t.Logf("exec container cmd: %q",command)
198-
cli,err:=client.NewClientWithOpts(client.FromEnv,client.WithAPIVersionNegotiation())
199-
require.NoError(t,err,"connect to docker")
200-
defercli.Close()
201-
execConfig:= types.ExecConfig{
202-
AttachStdout:true,
203-
AttachStderr:true,
204-
Cmd: []string{"/bin/sh","-c",command},
205-
}
206-
ex,err:=cli.ContainerExecCreate(ctx,containerID,execConfig)
207-
require.NoError(t,err,"create container exec")
208-
resp,err:=cli.ContainerExecAttach(ctx,ex.ID, types.ExecStartCheck{})
209-
require.NoError(t,err,"attach to container exec")
210-
deferresp.Close()
211-
varbuf bytes.Buffer
212-
_,err=stdcopy.StdCopy(&buf,&buf,resp.Reader)
213-
require.NoError(t,err,"read stdout")
214-
out:=buf.String()
215-
t.Log("exec container output:\n"+out)
216-
execResp,err:=cli.ContainerExecInspect(ctx,ex.ID)
217-
require.NoError(t,err,"get exec exit code")
218-
returnout,execResp.ExitCode
219-
}
220-
221191
// randomPort is a helper function to find a free random port.
222192
// Note that the OS may reallocate the port very quickly, so
223193
// this is not _guaranteed_.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp