Skip to content

Commit 596b50b

Browse files
afrittolitekton-robot
authored andcommitted
Add some env variables to the e2e script
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>
1 parent 23ffdba commit 596b50b

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

test/e2e-tests-kind.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SKIP_INITIALIZE=true
2+
PIPELINE_FEATURE_GATE=stable
3+
RUN_YAML_TESTS=false
4+
KO_DOCKER_REPO=registry.local:5000

test/e2e-tests.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@
1919

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

22+
23+
# Setting defaults
24+
PIPELINE_FEATURE_GATE=${PIPELINE_FEATURE_GATE:-stable}
25+
SKIP_INITIALIZE=${SKIP_INITIALIZE:="false"}
26+
RUN_YAML_TESTS=${RUN_YAML_TESTS:="true"}
27+
failed=0
28+
2229
# Script entry point.
2330

24-
initialize $@
31+
if [ "${SKIP_INITIALIZE}" != "true" ]; then
32+
initialize $@
33+
fi
2534

2635
header "Setting up environment"
2736

@@ -49,17 +58,13 @@ function run_e2e() {
4958
# Run these _after_ the integration tests b/c they don't quite work all the way
5059
# and they cause a lot of noise in the logs, making it harder to debug integration
5160
# test failures.
52-
go_test_e2e -tags=examples -timeout=20m ./test/ || failed=1
61+
if [ "${RUN_YAML_TESTS}" == "true"]; then
62+
go_test_e2e -tags=examples -timeout=20m ./test/ || failed=1
63+
fi
5364
}
5465

55-
if [ "$PIPELINE_FEATURE_GATE" == "" ]; then
56-
set_feature_gate "stable"
57-
run_e2e
58-
else
59-
set_feature_gate "$PIPELINE_FEATURE_GATE"
60-
run_e2e
61-
fi
62-
66+
set_feature_gate "$PIPELINE_FEATURE_GATE"
67+
run_e2e
6368

6469
(( failed )) && fail_test
6570
success

0 commit comments

Comments
 (0)