Skip to content

Commit 3950521

Browse files
Vincent Houtekton-robot
authored andcommitted
Add comments about the two scenarios for upgrade tests
1 parent 56147ea commit 3950521

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

test/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ To run the YAML e2e tests, run the following command:
205205
206206
### Running upgrade tests
207207
208+
There are two scenarios in upgrade tests. One is to install the previous release, upgrade to the current release, and
209+
validate whether the Tekton pipeline works. The other is to install the previous release, create the pipelines and tasks,
210+
upgrade to the current release, and validate whether the Tekton pipeline works.
211+
208212
To run the upgrade tests, run the following command:
209213
210214
```bash

test/e2e-common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function install_pipeline_crd() {
135135
# Install the Tekton pipeline crd based on the release number
136136
function install_pipeline_crd_version() {
137137
echo ">> Deploying Tekton Pipelines of Version $1"
138-
kubectl apply -f "https://github.com/tektoncd/pipeline/releases/download/v$1/release.yaml" || fail_test "Build pipeline installation failed of Version $1"
138+
kubectl apply -f "https://github.com/tektoncd/pipeline/releases/download/$1/release.yaml" || fail_test "Build pipeline installation failed of Version $1"
139139
verify_pipeline_installation
140140
}
141141

@@ -161,7 +161,7 @@ function uninstall_pipeline_crd() {
161161

162162
function uninstall_pipeline_crd_version() {
163163
echo ">> Uninstalling Tekton Pipelines of version $1"
164-
kubectl delete --ignore-not-found=true -f "https://github.com/tektoncd/pipeline/releases/download/v$1/release.yaml"
164+
kubectl delete --ignore-not-found=true -f "https://github.com/tektoncd/pipeline/releases/download/$1/release.yaml"
165165

166166
# Make sure that everything is cleaned up in the current namespace.
167167
for res in conditions pipelineresources tasks pipelines taskruns pipelineruns; do

test/e2e-tests-upgrade.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@
1515
# limitations under the License.
1616

1717
# This script calls out to scripts in tektoncd/plumbing to setup a cluster
18-
# and deploy Tekton Pipelines to it for running integration tests.
18+
# and deploy Tekton Pipelines to it for running upgrading tests. There are
19+
# two scenarios we need to cover in this script:
20+
21+
# Scenario 1: install the previous release, upgrade to the current release, and
22+
# validate whether the Tekton pipeline works.
23+
24+
# Scenario 2: install the previous release, create the pipelines and tasks, upgrade
25+
# to the current release, and validate whether the Tekton pipeline works.
1926

2027
source $(dirname $0)/e2e-common.sh
21-
PREVIOUS_PIPELINE_VERSION=0.5.2
28+
PREVIOUS_PIPELINE_VERSION=v0.5.2
2229

2330
# Script entry point.
2431

@@ -30,16 +37,20 @@ header "Setting up environment"
3037
set +o errexit
3138
set +o pipefail
3239

40+
# First, we will verify if Scenario 1 works.
41+
# Install the previous release.
3342
header "Install the previous release of Tekton pipeline $PREVIOUS_PIPELINE_VERSION"
3443
install_pipeline_crd_version $PREVIOUS_PIPELINE_VERSION
3544

45+
# Upgrade to the current release.
3646
header "Upgrade to the current release of Tekton pipeline"
3747
install_pipeline_crd
3848

39-
# Run the tests
49+
# Run the integration tests.
4050
failed=0
4151
go_test_e2e -timeout=20m ./test || failed=1
4252

53+
# Run the post-integration tests.
4354
for test in taskrun pipelinerun; do
4455
header "Running YAML e2e tests for ${test}s"
4556
if ! run_yaml_tests ${test}; then
@@ -50,23 +61,32 @@ for test in taskrun pipelinerun; do
5061
fi
5162
done
5263

53-
# Remove all the pipeline CRDs
64+
# Remove all the pipeline CRDs, and clean up the environment for next Scenario.
5465
uninstall_pipeline_crd
5566
uninstall_pipeline_crd_version $PREVIOUS_PIPELINE_VERSION
5667

68+
# Next, we will verify if Scenario 2 works.
69+
# Install the previous release.
5770
header "Install the previous release of Tekton pipeline $PREVIOUS_PIPELINE_VERSION"
5871
install_pipeline_crd_version $PREVIOUS_PIPELINE_VERSION
5972

73+
# Create the resources of taskrun and pipelinerun, under the directories example/taskrun
74+
# and example/pipelinerun.
6075
for test in taskrun pipelinerun; do
6176
header "Applying the resources ${test}s"
6277
apply_resources ${test}
6378
done
6479

80+
# Upgrade to the current release.
6581
header "Upgrade to the current release of Tekton pipeline"
6682
install_pipeline_crd
6783

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

87+
# Run the post-integration tests. We do not need to install the resources again, since
88+
# they are installed before the upgrade. We verify if they still work, after going through
89+
# the upgrade.
7090
for test in taskrun pipelinerun; do
7191
header "Running YAML e2e tests for ${test}s"
7292
if ! run_tests ${test}; then

0 commit comments

Comments
 (0)