Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/knative/build v0.6.0 // indirect
github.com/knative/pkg v0.0.0-20190518173526-34792a92cec2
github.com/knative/serving v0.6.0
github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1
github.com/knative/test-infra v0.0.0-20190617165445-9320a359edc4
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/modern-go/reflect2 v1.0.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9 h1:2kupVzyk+zet
github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1 h1:Y2QunZIzGuyvBNfWNpwK9/AAgu2P+Aa+k/3ykATGw30=
github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
github.com/knative/test-infra v0.0.0-20190617165445-9320a359edc4 h1:TzSOrdve0QAWRkrZenCdG87fLpXCKJREx2AnLhq7DMA=
github.com/knative/test-infra v0.0.0-20190617165445-9320a359edc4/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
Expand Down
39 changes: 39 additions & 0 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Copyright 2019 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 runs the end-to-end tests for the kn client.

# If you already have the `KO_DOCKER_REPO` environment variable set and a
# cluster setup and currently selected in your kubeconfig, call the script
# with the `--run-tests` argument and it will use the cluster and run the tests.

# Calling this script without arguments will create a new cluster in
# project $PROJECT_ID, start Knative serving, run the tests and delete
# the cluster.

KNATIVE_VERSION="latest"

# Parse the custom flags.
function parse_flags() {
case "$1" in
--knative-version)
[[ $2 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || abort "version format must be '[0-9].[0-9].[0-9]'"
readonly KNATIVE_VERSION=$2
return 2
;;
esac
return 0
}
21 changes: 13 additions & 8 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# the cluster.

source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/e2e-tests.sh
source $(dirname $0)/e2e-common.sh

# Helper functions.

Expand All @@ -35,18 +36,22 @@ function cluster_setup() {
}

function knative_setup() {
start_latest_knative_serving
header "Installing Knative serving version of $KNATIVE_VERSION"
start_knative_serving_env "$KNATIVE_VERSION"
}

function start_knative_serving_env() {
local VERSION=${1:-latest}
if [ "$VERSION" = "latest" ]; then
start_latest_knative_serving
else
start_release_knative_serving "${VERSION}"
fi;
}

# Add local dir to have access to built kn
export PATH=$PATH:${REPO_ROOT_DIR}

# Script entry point.

initialize $@

header "Running tests"

header "Running tests for Knative serving version of $KNATIVE_VERSION"
go_test_e2e ./test/e2e || fail_test

success
18 changes: 17 additions & 1 deletion test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,23 @@ export DISABLE_MD_LINTING=1

export GO111MODULE=on
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/presubmit-tests.sh
source $(dirname $0)/e2e-common.sh

# We use the default build, unit and integration test runners.
# We use the default build, and unit test runners.
# We customize the integration test runner, since we plan to run the tests against previous Knative release.
function integration_tests() {
echo "Getting into custome integration test ${e2e_test} for $KNATIVE_VERSION"
local options=""
local failed=0
(( EMIT_METRICS )) && options="--emit-metrics --knative-version $KNATIVE_VERSION"
for e2e_test in $(find test/ -name e2e-*tests.sh); do
echo "Running integration test ${e2e_test}"
if ! ${e2e_test} ${options}; then
failed=1
fi
done
return ${failed}
}

parse_flags $@
main $@
184 changes: 97 additions & 87 deletions vendor/github.com/knative/test-infra/scripts/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading