From 567f0965fb018a69999e6f24bbe3c67ab51a38db Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Mon, 23 Oct 2023 13:06:13 +0200 Subject: [PATCH] fix: ci pipeline --- runnable-mail_test.go | 6 ++++-- runnable-sftp_test.go | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/runnable-mail_test.go b/runnable-mail_test.go index 8fbc22a..a0705f8 100644 --- a/runnable-mail_test.go +++ b/runnable-mail_test.go @@ -13,7 +13,7 @@ import ( "time" ) -func startTestSMTPDockerImageAndContainer(t *testing.T, host string, port string, ctx context.Context) error { +func startTestSMTPDockerImageAndContainer(t *testing.T, port string, ctx context.Context) error { t.Helper() cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) @@ -32,6 +32,8 @@ func startTestSMTPDockerImageAndContainer(t *testing.T, host string, port string //_, _ = io.Copy(os.Stdout, reader) _ = reader + host, _, _ := net.SplitHostPort(cli.DaemonHost()) + hostConfig := &container.HostConfig{ PortBindings: nat.PortMap{ "1025/tcp": []nat.PortBinding{ @@ -120,7 +122,7 @@ func TestMailRunner(t *testing.T) { done := make(chan bool) go func() { - err = startTestSMTPDockerImageAndContainer(t, host, portAsString, ctx) + err = startTestSMTPDockerImageAndContainer(t, portAsString, ctx) if err != nil { t.Errorf("Unexpected error: %v", err) cancel() diff --git a/runnable-sftp_test.go b/runnable-sftp_test.go index cfca7ef..5cad56d 100644 --- a/runnable-sftp_test.go +++ b/runnable-sftp_test.go @@ -14,7 +14,7 @@ import ( "time" ) -func startSFTPTestDockerImageAndContainer(t *testing.T, host string, port string, volume string, ctx context.Context) error { +func startSFTPTestDockerImageAndContainer(t *testing.T, port string, volume string, ctx context.Context) error { t.Helper() cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) @@ -33,6 +33,8 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, host string, port string //_, _ = io.Copy(os.Stdout, reader) _ = reader + host, _, _ := net.SplitHostPort(cli.DaemonHost()) + hostConfig := &container.HostConfig{ PortBindings: nat.PortMap{ "22/tcp": []nat.PortBinding{ @@ -120,7 +122,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) { done := make(chan bool) go func() { - err = startSFTPTestDockerImageAndContainer(t, host, portAsString, "", ctx) + err = startSFTPTestDockerImageAndContainer(t, "portAsString, "", ctx) if err != nil { t.Errorf("Unexpected error: %v", err) cancel() @@ -225,7 +227,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) { done := make(chan bool) go func() { - err = startSFTPTestDockerImageAndContainer(t, host, portAsString, tempSrcDir, ctx) + err = startSFTPTestDockerImageAndContainer(t, portAsString, tempSrcDir, ctx) if err != nil { t.Errorf("Unexpected error: %v", err) cancel() -- GitLab