From e2cca422c94d75a1d6af792d66c12046e793a999 Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Sun, 24 Mar 2024 15:55:49 +0100 Subject: [PATCH] Fix tests --- pipeline/backend/docker/convert_test.go | 6 ++---- pipeline/backend/kubernetes/pod_test.go | 7 +------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pipeline/backend/docker/convert_test.go b/pipeline/backend/docker/convert_test.go index 435d669b4b..b114398f6f 100644 --- a/pipeline/backend/docker/convert_test.go +++ b/pipeline/backend/docker/convert_test.go @@ -105,8 +105,7 @@ func TestToConfigSmall(t *testing.T) { assert.EqualValues(t, &container.Config{ AttachStdout: true, AttachStderr: true, - Cmd: []string{"echo $CI_SCRIPT | base64 -d | /bin/sh -e"}, - Entrypoint: []string{"/bin/sh", "-c"}, + Entrypoint: []string{"/bin/sh", "-c", "echo $CI_SCRIPT | base64 -d | /bin/sh -e"}, Labels: map[string]string{ "wp_step": "test", "wp_uuid": "09238932", @@ -163,8 +162,7 @@ func TestToConfigFull(t *testing.T) { WorkingDir: "/src/abc", AttachStdout: true, AttachStderr: true, - Cmd: []string{"echo $CI_SCRIPT | base64 -d | /bin/sh -e"}, - Entrypoint: []string{"/bin/sh", "-c"}, + Entrypoint: []string{"/bin/sh", "-c", "echo $CI_SCRIPT | base64 -d | /bin/sh -e"}, Labels: map[string]string{ "wp_step": "test", "wp_uuid": "09238932", diff --git a/pipeline/backend/kubernetes/pod_test.go b/pipeline/backend/kubernetes/pod_test.go index bf09727437..0f781f8ebe 100644 --- a/pipeline/backend/kubernetes/pod_test.go +++ b/pipeline/backend/kubernetes/pod_test.go @@ -90,9 +90,7 @@ func TestTinyPod(t *testing.T) { "image": "gradle:8.4.0-jdk21", "command": [ "/bin/sh", - "-c" - ], - "args": [ + "-c", "echo $CI_SCRIPT | base64 -d | /bin/sh -e" ], "workingDir": "/woodpecker/src", @@ -183,9 +181,6 @@ func TestFullPod(t *testing.T) { "/bin/sh", "-c" ], - "args": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], "workingDir": "/woodpecker/src", "ports": [ {