Skip to content

Commit

Permalink
Allow setting embedded status feature flag to minimal in tests
Browse files Browse the repository at this point in the history
We recently added support for minimal embedded status, which is gated
behind the `embedded-status` feature flag. In this change, we support
setting `embedded-status` when running end-to-end tests. It defaults
to "full" because this is the current default value for the flag.
  • Loading branch information
jerop authored and tekton-robot committed Jun 23, 2022
1 parent 5d82fca commit b12907f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ source $(git rev-parse --show-toplevel)/test/e2e-common.sh

# Setting defaults
PIPELINE_FEATURE_GATE=${PIPELINE_FEATURE_GATE:-stable}
EMBEDDED_STATUS_GATE=${EMBEDDED_STATUS_GATE:-full}
SKIP_INITIALIZE=${SKIP_INITIALIZE:="false"}
RUN_YAML_TESTS=${RUN_YAML_TESTS:="true"}
failed=0
Expand Down Expand Up @@ -50,6 +51,18 @@ function set_feature_gate() {
kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch"
}

function set_embedded_status() {
local status="$1"
if [ "$status" != "full" ] && [ "$status" != "minimal" ] && [ "$status" != "both" ] ; then
printf "Invalid embedded status %s\n" ${status}
exit 255
fi
printf "Setting embedded status to %s\n", ${status}
jsonpatch=$(printf "{\"data\": {\"embedded-status\": \"%s\"}}" $1)
echo "feature-flags ConfigMap patch: ${jsonpatch}"
kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch"
}

function run_e2e() {
# Run the integration tests
header "Running Go e2e tests"
Expand All @@ -64,6 +77,7 @@ function run_e2e() {
}

set_feature_gate "$PIPELINE_FEATURE_GATE"
set_embedded_status "$EMBEDDED_STATUS_GATE"
run_e2e

(( failed )) && fail_test
Expand Down

0 comments on commit b12907f

Please sign in to comment.