Skip to content

Commit d545ea4

Browse files
committed
Add env files for Kind-in-Prow integration test jobs
The existing `test/e2e-tests-kind.env` is specifically for the `PipelineRun` approach. These new files are for running the e2e tests, via `kind`, in Prow. There are four new env files - one for just the go e2e tests each for `stable` and `alpha`, and one for just the yaml tests each for `stable` and `alpha`. Additionally, `examples/v1beta1/taskruns/git-volume.yaml` is moved to `examples/v1beta1/taskruns/no-ci/git-volume.yaml`. This is because Kind nodes don't have `git` installed, which is necessary for git volumes to work. Also, `--ignore-path=/product_uuid` has been added to the Kaniko args in `examples/v1beta1/pipelineruns/pipelinerun.yaml` and `test/yamls/v1beta1/pipelineruns/pipelinerun.yaml` to work around an issue with Kaniko multi-stage builds on Kind (GoogleContainerTools/kaniko#2164). Signed-off-by: Andrew Bayer <[email protected]>
1 parent d3b8017 commit d545ea4

File tree

9 files changed

+40
-6
lines changed

9 files changed

+40
-6
lines changed

examples/v1beta1/pipelineruns/pipelinerun.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ spec:
142142
default: ""
143143
- name: BUILDER_IMAGE
144144
description: The image on which builds will run
145-
default: gcr.io/kaniko-project/executor:v1.3.0
145+
default: gcr.io/kaniko-project/executor:v1.8.1
146146
- name: baseImage
147147
description: Base image for GoogleContainerTools/skaffold microservice apps
148148
default: BASE=alpine:3.9
@@ -166,6 +166,7 @@ spec:
166166
- --destination=$(params.IMAGE)
167167
- --oci-layout-path=$(workspaces.source.path)/$(params.CONTEXT)/image-digest
168168
- --build-arg=$(inputs.params.baseImage)
169+
- --ignore-path=/product_uuid # TODO(abayer): Work around Kaniko multi-stage build issues on Kind: https://github.com/GoogleContainerTools/kaniko/issues/2164
169170
# kaniko assumes it is running as root, which means this example fails on platforms
170171
# that default to run containers as random uid (like OpenShift). Adding this securityContext
171172
# makes it explicit that it needs to run as root.

test/e2e-common.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri
2020

2121
function install_pipeline_crd() {
2222
echo ">> Deploying Tekton Pipelines"
23-
ko resolve -R -f config/ \
24-
| sed -e 's%"level": "info"%"level": "debug"%' \
23+
local ko_target="$(mktemp)"
24+
ko resolve -R -f config/ > "${ko_target}" || fail_test "Pipeline image resolve failed"
25+
cat "${ko_target}" | sed -e 's%"level": "info"%"level": "debug"%' \
2526
| sed -e 's%loglevel.controller: "info"%loglevel.controller: "debug"%' \
2627
| sed -e 's%loglevel.webhook: "info"%loglevel.webhook: "debug"%' \
2728
| kubectl apply -R -f - || fail_test "Build pipeline installation failed"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SKIP_INITIALIZE=true
2+
PIPELINE_FEATURE_GATE=alpha
3+
EMBEDDED_STATUS_GATE=minimal
4+
RUN_YAML_TESTS=true
5+
SKIP_GO_E2E_TESTS=true
6+
KO_DOCKER_REPO=registry.local:5000
7+
E2E_GO_TEST_TIMEOUT=40m

test/e2e-tests-kind-prow-alpha.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SKIP_INITIALIZE=true
2+
PIPELINE_FEATURE_GATE=alpha
3+
EMBEDDED_STATUS_GATE=minimal
4+
RUN_YAML_TESTS=true
5+
KO_DOCKER_REPO=registry.local:5000
6+
E2E_GO_TEST_TIMEOUT=40m

test/e2e-tests-kind-prow-yaml.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SKIP_INITIALIZE=true
2+
PIPELINE_FEATURE_GATE=stable
3+
RUN_YAML_TESTS=true
4+
SKIP_GO_E2E_TESTS=true
5+
KO_DOCKER_REPO=registry.local:5000
6+
E2E_GO_TEST_TIMEOUT=40m

test/e2e-tests-kind-prow.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SKIP_INITIALIZE=true
2+
PIPELINE_FEATURE_GATE=stable
3+
RUN_YAML_TESTS=true
4+
KO_DOCKER_REPO=registry.local:5000
5+
E2E_GO_TEST_TIMEOUT=40m

test/e2e-tests.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ PIPELINE_FEATURE_GATE=${PIPELINE_FEATURE_GATE:-stable}
2525
EMBEDDED_STATUS_GATE=${EMBEDDED_STATUS_GATE:-full}
2626
SKIP_INITIALIZE=${SKIP_INITIALIZE:="false"}
2727
RUN_YAML_TESTS=${RUN_YAML_TESTS:="true"}
28+
SKIP_GO_E2E_TESTS=${SKIP_GO_E2E_TESTS:="false"}
29+
E2E_GO_TEST_TIMEOUT=${E2E_GO_TEST_TIMEOUT:="20m"}
2830
failed=0
2931

3032
# Script entry point.
@@ -66,13 +68,16 @@ function set_embedded_status() {
6668
function run_e2e() {
6769
# Run the integration tests
6870
header "Running Go e2e tests"
69-
go_test_e2e -timeout=20m ./test/... || failed=1
71+
# Skip ./test/*.go tests if SKIP_GO_E2E_TESTS == true
72+
if [ "${SKIP_GO_E2E_TESTS}" != "true" ]; then
73+
go_test_e2e -timeout=${E2E_GO_TEST_TIMEOUT} ./test/... || failed=1
74+
fi
7075

7176
# Run these _after_ the integration tests b/c they don't quite work all the way
7277
# and they cause a lot of noise in the logs, making it harder to debug integration
7378
# test failures.
7479
if [ "${RUN_YAML_TESTS}" == "true" ]; then
75-
go_test_e2e -parallel=4 -mod=readonly -tags=examples -timeout=20m ./test/ || failed=1
80+
go_test_e2e -mod=readonly -tags=examples -timeout=${E2E_GO_TEST_TIMEOUT} ./test/ || failed=1
7681
fi
7782
}
7883

test/yamls/v1beta1/pipelineruns/pipelinerun.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ spec:
142142
default: ""
143143
- name: BUILDER_IMAGE
144144
description: The image on which builds will run
145-
default: gcr.io/kaniko-project/executor:v1.3.0
145+
default: gcr.io/kaniko-project/executor:v1.8.1
146146
- name: baseImage
147147
description: Base image for GoogleContainerTools/skaffold microservice apps
148148
default: BASE=alpine:3.9
@@ -166,13 +166,16 @@ spec:
166166
- --destination=$(params.IMAGE)
167167
- --oci-layout-path=$(workspaces.source.path)/$(params.CONTEXT)/image-digest
168168
- --build-arg=$(inputs.params.baseImage)
169+
- --ignore-path=/product_uuid # TODO(abayer): Work around Kaniko multi-stage build issues on Kind: https://github.com/GoogleContainerTools/kaniko/issues/2164
169170
# kaniko assumes it is running as root, which means this example fails on platforms
170171
# that default to run containers as random uid (like OpenShift). Adding this securityContext
171172
# makes it explicit that it needs to run as root.
172173
securityContext:
173174
runAsUser: 0
174175
- name: write-digest
175176
workingDir: $(workspaces.source.path)
177+
# TODO(abayer): Using ko:// means we end up rebuilding the image, which can be annoying. Consider alternatives while ensuring
178+
# we're always replacing the ko:// images with ones already built from our source...
176179
image: ko://github.com/tektoncd/pipeline/cmd/imagedigestexporter
177180
# output of imagedigestexport [{"name":"image","digest":"sha256:eed29..660"}]
178181
command: ["/ko-app/imagedigestexporter"]

0 commit comments

Comments
 (0)