Skip to content

Commit

Permalink
Cleanup e2e test scripts
Browse files Browse the repository at this point in the history
Remove unnecessary environment variables
Remove unused functions
Remove bad `kill` command using unset variable
Fix typos
  • Loading branch information
AlanGreene authored and tekton-robot committed Jul 11, 2022
1 parent fbd25ff commit 00cff00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
18 changes: 2 additions & 16 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function install_pipelines() {
echo ">> Deploying Tekton Pipelines ($version)"
kubectl apply --filename "https://github.com/tektoncd/pipeline/releases/download/$version/release.yaml" || fail_test "Tekton Pipelines installation failed"

# Make sure thateveything is cleaned up in the current namespace.
# Make sure that everything is cleaned up in the current namespace.
for res in pipelineresources tasks pipelines taskruns pipelineruns; do
kubectl delete --ignore-not-found=true ${res}.tekton.dev --all
done
Expand All @@ -64,20 +64,6 @@ function install_triggers() {
wait_until_pods_running tekton-pipelines || fail_test "Tekton Triggers did not come up"
}

function uninstall_pipelines() {
local version=$1

echo ">> Deleting Tekton Pipelines ($version)"
kubectl delete --filename "https://github.com/tektoncd/pipeline/releases/download/$version/release.yaml" || fail_test "Tekton Pipelines deletion failed"
}

function uninstall_triggers() {
local version=$1

echo ">> Deleting Tekton Triggers ($version)"
kubectl delete --filename "https://github.com/tektoncd/triggers/releases/download/$version/release.yaml" || fail_test "Tekton Triggers deletion failed"
}

# Called by `fail_test` (provided by `e2e-tests.sh`) to dump info on test failure
function dump_extra_cluster_state() {
echo ">>> Pipeline controller log:"
Expand Down Expand Up @@ -147,7 +133,7 @@ function curl_envsubst_resource() {
exit 1
fi
set -x
cat "$1" | envsubst | curl -sS -X "$2" --data-binary @- -H "Content-Type: application/yaml" "$3" -H "Tekton-Client: tektoncd/dashboard"
cat "$1" | envsubst | curl -sS -X "$2" --data-binary @- -H "Content-Type: application/yaml" "$3" -H "Tekton-Client: tektoncd/dashboard-e2e"
set +x
}

Expand Down
5 changes: 1 addition & 4 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Copyright 2018-2021 The Tekton Authors
# Copyright 2018-2022 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -81,8 +81,6 @@ test_dashboard() {
fi

# API/resource configuration
export APP_SERVICE_ACCOUNT="e2e-tests"
export PIPELINE_NAME="simple-pipeline"
export PIPELINE_RUN_NAME="e2e-pipelinerun"
export POD_LABEL="tekton.dev/pipelineRun=$PIPELINE_RUN_NAME"
export EXPECTED_RETURN_VALUE="Hello World!"
Expand Down Expand Up @@ -198,7 +196,6 @@ test_dashboard() {
--global-var readonly=$readonly || fail_test "Postman Triggers collection tests failed"

kill -9 $dashboardForwardPID
kill -9 $podForwardPID

$tekton_repo_dir/scripts/installer uninstall ${@:2}

Expand Down
4 changes: 2 additions & 2 deletions test/resources/envsubst/pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ metadata:
app: e2e-pipelinerun
spec:
pipelineRef:
name: ${PIPELINE_NAME}
serviceAccountName: ${APP_SERVICE_ACCOUNT}
name: simple-pipeline
serviceAccountName: e2e-tests

0 comments on commit 00cff00

Please sign in to comment.