Skip to content

Commit

Permalink
Enable cluster provisioning on all e2e (istio#3790)
Browse files Browse the repository at this point in the history
* Enable cluster provisioning on all e2e

* Enable mason for istio-pilot-e2e

* Fixed typo

* Set TEST_TARGETS as an array

* Fix typo
  • Loading branch information
sebastienvas authored Feb 27, 2018
1 parent 151c69e commit 3db4261
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 47 deletions.
18 changes: 0 additions & 18 deletions prow/e2e-cluster_wide-auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,7 @@ set -u
# Print commands
set -x

# Check https://github.com/istio/test-infra/blob/master/boskos/configs.yaml
# for exiting resources types
RESOURCE_TYPE='gke-e2e-test'
OWNER="$(basename "${BASH_SOURCE[0]}")"
INFO_PATH="$(mktemp)"
FILE_LOG="$(mktemp)"
ROOT=$(cd $(dirname $0)/..; pwd)

function cleanup() {
mason_cleanup
cat "${FILE_LOG}"
}

source "${ROOT}/prow/mason_lib.sh"
source "${ROOT}/prow/cluster_lib.sh"

trap mason_cleanup EXIT
get_resource "${RESOURCE_TYPE}" "${OWNER}" "${INFO_PATH}" "${FILE_LOG}"
setup_cluster

echo 'Running cluster-wide e2e rbac, auth Tests'
${ROOT}/prow/e2e-suite.sh --test_vm --auth_enable --cluster_wide --mason_info="${INFO_PATH}" "$@"
18 changes: 0 additions & 18 deletions prow/e2e-suite-rbac-no_auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,7 @@ set -u
# Print commands
set -x

# Check https://github.com/istio/test-infra/blob/master/boskos/configs.yaml
# for exiting resources types
RESOURCE_TYPE='gke-e2e-test'
OWNER="$(basename "${BASH_SOURCE[0]}")"
INFO_PATH="$(mktemp)"
FILE_LOG="$(mktemp)"
ROOT=$(cd $(dirname $0)/..; pwd)

function cleanup() {
mason_cleanup
cat "${FILE_LOG}"
}

source "${ROOT}/prow/mason_lib.sh"
source "${ROOT}/prow/cluster_lib.sh"

trap mason_cleanup EXIT
get_resource "${RESOURCE_TYPE}" "${OWNER}" "${INFO_PATH}" "${FILE_LOG}"
setup_cluster

echo 'Running e2e with rbac, no auth Tests'
./prow/e2e-suite.sh "$@"
30 changes: 25 additions & 5 deletions prow/e2e-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,27 @@ set -u
# Print commands
set -x

TESTS_TARGETS="e2e_simple e2e_mixer e2e_bookinfo e2e_upgrade"
TEST_TARGETS=(e2e_simple e2e_mixer e2e_bookinfo e2e_upgrade)
SINGLE_MODE=false
E2E_ARGS=()

source ${ROOT}/prow/lib.sh
# Check https://github.com/istio/test-infra/blob/master/boskos/configs.yaml
# for existing resources types
RESOURCE_TYPE="${RESOURCE_TYPE:-gke-e2e-test}"
OWNER='e2e-suite'
INFO_PATH="$(mktemp /tmp/XXXXX.boskos.info)"
FILE_LOG="$(mktemp /tmp/XXXXX.boskos.log)"

E2E_ARGS=(--mason_info="${INFO_PATH}")

source "${ROOT}/prow/lib.sh"
source "${ROOT}/prow/mason_lib.sh"
source "${ROOT}/prow/cluster_lib.sh"

function cleanup() {
mason_cleanup
cat "${FILE_LOG}"
}

setup_and_export_git_sha

if [ "${CI:-}" == 'bootstrap' ]; then
Expand All @@ -50,6 +66,10 @@ export TAG="${GIT_SHA}"

make init

trap cleanup EXIT
get_resource "${RESOURCE_TYPE}" "${OWNER}" "${INFO_PATH}" "${FILE_LOG}"
setup_cluster

# getopts only handles single character flags
for ((i=1; i<=$#; i++)); do
case ${!i} in
Expand All @@ -68,14 +88,14 @@ if ${SINGLE_MODE}; then

# Check if it's a valid test file
VALID_TEST=false
for T in ${TESTS_TARGETS[@]}; do
for T in ${TEST_TARGETS[@]}; do
if [ "${T}" == "${SINGLE_TEST}" ]; then
VALID_TEST=true
time ISTIO_DOCKER_HUB=$HUB E2E_ARGS="${E2E_ARGS[@]}" make "${SINGLE_TEST}"
fi
done
if [ "${VALID_TEST}" == "false" ]; then
echo "Invalid e2e test target, must be one of ${TESTSPATH}"
echo "Invalid e2e test target, must be one of ${TEST_TARGETS}"
# Fail if it's not a valid test file
process_result 1 'Invalid test target'
fi
Expand Down
25 changes: 19 additions & 6 deletions prow/istio-pilot-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,27 @@ set -u
# Print commands
set -x

source ${ROOT}/prow/lib.sh
setup_and_export_git_sha

export NUM_NODES=4
# Check https://github.com/istio/test-infra/blob/master/boskos/configs.yaml
# for existing resources types
RESOURCE_TYPE="${RESOURCE_TYPE:-gke-e2e-test}"
OWNER='istio-pilot-e2e'
INFO_PATH="$(mktemp /tmp/XXXXX.boskos.info)"
FILE_LOG="$(mktemp /tmp/XXXXX.boskos.log)"

source "${ROOT}/prow/lib.sh"
source "${ROOT}/prow/mason_lib.sh"
source "${ROOT}/prow/cluster_lib.sh"

trap delete_cluster EXIT
create_cluster 'e2e-pilot'
function cleanup() {
mason_cleanup
cat "${FILE_LOG}"
}

setup_and_export_git_sha

trap cleanup EXIT
get_resource "${RESOURCE_TYPE}" "${OWNER}" "${INFO_PATH}" "${FILE_LOG}"
setup_cluster

HUB="gcr.io/istio-testing"

Expand Down

0 comments on commit 3db4261

Please sign in to comment.