Skip to content

Commit

Permalink
Add env files for Kind-in-Prow integration test jobs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
abayer committed Jul 7, 2022
1 parent 380dbd0 commit 3a3b2e8
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/v1beta1/pipelineruns/pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ spec:
default: ""
- name: BUILDER_IMAGE
description: The image on which builds will run
default: gcr.io/kaniko-project/executor:v1.3.0
default: gcr.io/kaniko-project/executor:v1.8.1
- name: baseImage
description: Base image for GoogleContainerTools/skaffold microservice apps
default: BASE=alpine:3.9
Expand All @@ -166,6 +166,7 @@ spec:
- --destination=$(params.IMAGE)
- --oci-layout-path=$(workspaces.source.path)/$(params.CONTEXT)/image-digest
- --build-arg=$(inputs.params.baseImage)
- --ignore-path=/product_uuid # TODO(abayer): Work around Kaniko multi-stage build issues on Kind: https://github.com/GoogleContainerTools/kaniko/issues/2164
# kaniko assumes it is running as root, which means this example fails on platforms
# that default to run containers as random uid (like OpenShift). Adding this securityContext
# makes it explicit that it needs to run as root.
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions test/e2e-tests-kind-prow-alpha-yaml.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_INITIALIZE=true
PIPELINE_FEATURE_GATE=alpha
EMBEDDED_STATUS_GATE=minimal
RUN_YAML_TESTS=true
SKIP_GO_E2E_TESTS=true
KO_DOCKER_REPO=registry.local:5000
E2E_GO_TEST_TIMEOUT=40m
6 changes: 6 additions & 0 deletions test/e2e-tests-kind-prow-alpha.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SKIP_INITIALIZE=true
PIPELINE_FEATURE_GATE=alpha
EMBEDDED_STATUS_GATE=minimal
RUN_YAML_TESTS=false
KO_DOCKER_REPO=registry.local:5000
E2E_GO_TEST_TIMEOUT=40m
6 changes: 6 additions & 0 deletions test/e2e-tests-kind-prow-yaml.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SKIP_INITIALIZE=true
PIPELINE_FEATURE_GATE=stable
RUN_YAML_TESTS=true
SKIP_GO_E2E_TESTS=true
KO_DOCKER_REPO=registry.local:5000
E2E_GO_TEST_TIMEOUT=40m
5 changes: 5 additions & 0 deletions test/e2e-tests-kind-prow.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SKIP_INITIALIZE=true
PIPELINE_FEATURE_GATE=stable
RUN_YAML_TESTS=false
KO_DOCKER_REPO=registry.local:5000
E2E_GO_TEST_TIMEOUT=40m
9 changes: 7 additions & 2 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ PIPELINE_FEATURE_GATE=${PIPELINE_FEATURE_GATE:-stable}
EMBEDDED_STATUS_GATE=${EMBEDDED_STATUS_GATE:-full}
SKIP_INITIALIZE=${SKIP_INITIALIZE:="false"}
RUN_YAML_TESTS=${RUN_YAML_TESTS:="true"}
SKIP_GO_E2E_TESTS=${SKIP_GO_E2E_TESTS:="false"}
E2E_GO_TEST_TIMEOUT=${E2E_GO_TEST_TIMEOUT:="20m"}
failed=0

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

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

Expand Down
3 changes: 2 additions & 1 deletion test/yamls/v1beta1/pipelineruns/pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ spec:
default: ""
- name: BUILDER_IMAGE
description: The image on which builds will run
default: gcr.io/kaniko-project/executor:v1.3.0
default: gcr.io/kaniko-project/executor:v1.8.1
- name: baseImage
description: Base image for GoogleContainerTools/skaffold microservice apps
default: BASE=alpine:3.9
Expand All @@ -166,6 +166,7 @@ spec:
- --destination=$(params.IMAGE)
- --oci-layout-path=$(workspaces.source.path)/$(params.CONTEXT)/image-digest
- --build-arg=$(inputs.params.baseImage)
- --ignore-path=/product_uuid # TODO(abayer): Work around Kaniko multi-stage build issues on Kind: https://github.com/GoogleContainerTools/kaniko/issues/2164
# kaniko assumes it is running as root, which means this example fails on platforms
# that default to run containers as random uid (like OpenShift). Adding this securityContext
# makes it explicit that it needs to run as root.
Expand Down

0 comments on commit 3a3b2e8

Please sign in to comment.