Skip to content

Commit

Permalink
Add some env variables to the e2e script
Browse files Browse the repository at this point in the history
Add three switches (env variables) in the main e2e script, that
can be used to:
- skip setting up the test environment
- skip running the YAML based tests
- set the feature gate (this is also available as ENV var

They are useful for setting up the E2E tests in KinD clusters, as
well as generally useful for development purposes.

Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
  • Loading branch information
afrittoli committed Nov 30, 2021
1 parent df5cc01 commit b18a5e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions test/e2e-tests-kind.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SKIP_INITIALIZE=true
PIPELINE_FEATURE_GATE=stable
RUN_YAML_TESTS=false
25 changes: 15 additions & 10 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@

source $(git rev-parse --show-toplevel)/test/e2e-common.sh


# Setting defaults
PIPELINE_FEATURE_GATE=${PIPELINE_FEATURE_GATE:-stable}
SKIP_INITIALIZE=${SKIP_INITIALIZE:="false"}
RUN_YAML_TESTS=${RUN_YAML_TESTS:="true"}
failed=0

# Script entry point.

initialize $@
if [[ "${SKIP_INITIALIZE}" != "true" ]]; then
initialize $@
fi

header "Setting up environment"

Expand Down Expand Up @@ -49,17 +58,13 @@ function run_e2e() {
# 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.
go_test_e2e -tags=examples -timeout=20m ./test/ || failed=1
if [[ "${RUN_YAML_TESTS}" == "true"]]; then
go_test_e2e -tags=examples -timeout=20m ./test/ || failed=1
fi
}

if [ "$PIPELINE_FEATURE_GATE" == "" ]; then
set_feature_gate "stable"
run_e2e
else
set_feature_gate "$PIPELINE_FEATURE_GATE"
run_e2e
fi

set_feature_gate "$PIPELINE_FEATURE_GATE"
run_e2e

(( failed )) && fail_test
success

0 comments on commit b18a5e9

Please sign in to comment.