Skip to content

Commit

Permalink
Add upgrade tests to test main against previous release
Browse files Browse the repository at this point in the history
This commit adds the upgrade tests for testing main against the e2e
tests from the previous release to prevent regression. Incompatible
changes made in the current release cycle are expected to be catched.
  • Loading branch information
JeromeJu committed May 19, 2023
1 parent cec2422 commit c8cbdfe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,9 @@ function delete_pipeline_resources() {
function delete_resolvers_resources() {
kubectl delete --ignore-not-found=true resolutionrequests.resolution.tekton.dev --all
}

function get_tests_from_release() {
echo ">> Retrieving tests from release-$1"
RELEASE_BRANCH="release-$1"
git checkout $RELEASE_BRANCH
}
16 changes: 16 additions & 0 deletions test/e2e-tests-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
# Scenario 2: install the previous release, create the pipelines and tasks, upgrade
# to the current release, and validate whether the Tekton pipeline works.

# Scenario 3: install the current pipelines, use the integration tests from the previous release(s)
# to prevent regression. Incompatible changes made in the current release cycle are expected to fail
# and will be skipped after failing once.

source $(git rev-parse --show-toplevel)/test/e2e-common.sh
RELEASES='https://github.com/tektoncd/pipeline/releases/latest'
PREVIOUS_PIPELINE_VERSION=$(curl -L -s -H 'Accept: application/json' $RELEASES |
Expand Down Expand Up @@ -85,6 +89,18 @@ go_test_e2e -timeout=20m ./test || failed=1
# the upgrade.
go_test_e2e -tags=examples -timeout=20m ./test/ || failed=1

# Testing main against the latest release to detect regression.
# TODO: #5782 1) add previous LTS and supported releases
# 2) skip backward incompatible tests that failed once to keep tests running
header "Testing main against the latest release to detect regression"
get_tests_from_release $PREVIOUS_PIPELINE_VERSION

# Run the integration tests.
go_test_e2e -timeout=20m ./test || failed=1

# Run the post-integration tests.
go_test_e2e -tags=examples -timeout=20m ./test/ || failed=1

(( failed )) && fail_test

success

0 comments on commit c8cbdfe

Please sign in to comment.