forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run integration tests on presubmit using boskos (I think?)
Using the scripts from knative/test-infra, run the integration tests against a cluster created with boskos. A lot of the boskos stuff is still kind of magical, for example I have no idea what is controlling the $PROJECT_ID that is being used by knative projects on presubmit, but after wrestling with it a bit and hacking around `--run-tests` I was able to get it to work locally and deploy a cluster (I assume using boskos?). I'll follow up on this more later on and update the docs when I have more info. Assuming we can get knative/test-infra#169 merged I'll revert the change to `e2e-tests.sh` in the `vendor` dir. Fixes #16
- Loading branch information
1 parent
fbad053
commit c01b201
Showing
5 changed files
with
123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2018 The Knative Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script calls out to scripts in knative/test-infra to setup a cluster | ||
# and deploy the Pipeline CRD to it for running integration tests. | ||
|
||
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/e2e-tests.sh | ||
|
||
set -o xtrace | ||
set -o errexit | ||
set -o pipefail | ||
|
||
function take_down_pipeline() { | ||
header "Tearing down Pipeline CRD" | ||
ko delete --ignore-not-found=true -f config/ | ||
} | ||
trap take_down_pipeline EXIT | ||
|
||
# Called by `fail_test` (provided by `e2e-tests.sh`) to dump info on test failure | ||
function dump_extra_cluster_state() { | ||
for crd in pipelines pipelineruns tasks taskruns resources pipelineparams | ||
do | ||
echo ">>> $crd:" | ||
kubectl get $crd -o yaml --all-namespaces | ||
done | ||
echo ">>> Pipeline controller log:" | ||
kubectl -n knative-build-pipeline logs $(kubectl -n knative-build-pipeline get pods -l app=build-pipeline-controller -o name) | ||
echo ">>> Pipeline webhook log:" | ||
kubectl -n knative-build-pipeline logs $(kubectl -n knative-build-pipeline get pods -l app=build-pipeline-webhook -o name) | ||
} | ||
|
||
set +o xtrace | ||
header "Setting up environment" | ||
# The intialize method will attempt to create a new cluster in $PROJECT_ID unless | ||
# the `--run-tests` parameter is provided and `K8S_CLUSTER_OVERRIDE` is set, however | ||
# since knative/test-infra/scripts/presubmit-tests.sh doesn't propagate `--run-tests` | ||
# (and it's kind of a confusing param name), we'll infer it from the presence of | ||
# `K8S_CLUSTER_OVERRIDE` | ||
if [[ -z ${K8S_CLUSTER_OVERRIDE} ]]; then | ||
initialize | ||
else | ||
initialize --run-tests | ||
fi | ||
set -o xtrace | ||
|
||
# The scripts were initially setup to use the knative/serving style `DOCKER_REPO_OVERRIDE` | ||
# before knative/serving was updated to use `ko` + `KO_DOCKER_REPO`. If the scripts were | ||
# called with `KO_DOCKER_REPO` already set (i.e. using a user's own local cluster, we should | ||
# respect that). | ||
if ! [[ -z ${DOCKER_REPO_OVERRIDE} ]]; then | ||
export KO_DOCKER_REPO=${DOCKER_REPO_OVERRIDE} | ||
fi | ||
|
||
# Deploy the latest version of the Pipeline CRD. | ||
# TODO(#59) do we need to deploy the Build CRD as well? | ||
header "Deploying Pipeline CRD" | ||
ko apply -f config/ | ||
|
||
# Wait for pods to be running in the namespaces we are deploying to | ||
set +o xtrace | ||
wait_until_pods_running knative-build-pipeline || fail_test "Pipeline CRD did not come up" | ||
set -o xtrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.