Skip to content

Commit dbdb211

Browse files
authored
Enable Integration tests in GH actions (#1386)
* Enable Integration tests in GH actions E2E tests aren't running after being disable from prow. We are only running a tutorial as test. * Fix and Update the tkn cli install in e2e-common.sh Function to download cli didn't use ${} over the version and was failing. This fixes that. Also, install the go-unit-report. Also, remove the redundant step for downloading TKN CLI in action.
1 parent dcdeb2c commit dbdb211

4 files changed

Lines changed: 23 additions & 22 deletions

File tree

.github/workflows/kind-e2e.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- main
77
- release-*
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
913
defaults:
1014
run:
1115
shell: bash

.github/workflows/reusable-e2e.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
TEKTON_PIPELINES_RELEASE: "https://storage.googleapis.com/tekton-releases/pipeline/previous/${{ inputs.pipelines-release }}/release.yaml"
3232
# Note that we do not include the v prefix here so we can use it in all
3333
# the places this is used.
34-
TEKTON_CLI_RELEASE: "0.30.0"
34+
SKIP_INITIALIZE: true
3535

3636
steps:
3737
- name: Set up Go
@@ -43,12 +43,6 @@ jobs:
4343
with:
4444
version: tip
4545

46-
- name: Install tkn cli
47-
run: |
48-
curl -Lo ./tkn_${{ env.TEKTON_CLI_RELEASE }}_Linux_x86_64.tar.gz https://github.com/tektoncd/cli/releases/download/v${{ env.TEKTON_CLI_RELEASE }}/tkn_${{ env.TEKTON_CLI_RELEASE }}_Linux_x86_64.tar.gz
49-
tar xvzf ./tkn_${{ env.TEKTON_CLI_RELEASE }}_Linux_x86_64.tar.gz tkn
50-
chmod u+x ./tkn
51-
5246
- name: Check out our repo
5347
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
5448
with:
@@ -72,12 +66,14 @@ jobs:
7266
# Restart so picks up the changes.
7367
kubectl -n tekton-pipelines delete po -l app=tekton-pipelines-controller
7468
75-
- name: Install all the everythings
69+
- name: Run integration tests
7670
working-directory: ./src/github.com/tektoncd/chains
77-
timeout-minutes: 10
7871
run: |
79-
ko apply -BRf ./config/
72+
./test/presubmit-tests.sh --integration-tests
8073
74+
75+
- name: Run tutorial taskrun
76+
run: |
8177
kubectl patch configmap/chains-config \
8278
--namespace tekton-chains \
8379
--type merge \
@@ -88,10 +84,8 @@ jobs:
8884
8985
# TODO(vaikas): Better way to find when the chains has picked up
9086
# the changes
91-
sleep 10
87+
sleep 20
9288
93-
- name: Run tutorial taskrun
94-
run: |
9589
kubectl create -f https://raw.githubusercontent.com/tektoncd/chains/main/examples/taskruns/task-output-image.yaml
9690
9791
# Sleep so the taskrun shows up.
@@ -103,7 +97,7 @@ jobs:
10397
echo "Waiting for Chains to do it's thing"
10498
for i in {1..10}
10599
do
106-
./tkn tr describe --last -o jsonpath="{.metadata.annotations.chains\.tekton\.dev/transparency}" > tektonentry
100+
tkn tr describe --last -o jsonpath="{.metadata.annotations.chains\.tekton\.dev/transparency}" > tektonentry
107101
108102
if [ -s ./tektonentry ]; then
109103
if grep --quiet rekor.rekor-system.svc ./tektonentry ; then

test/e2e-common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/e2e-tests.sh
3131

3232
function install_tkn() {
3333
echo ">> Installing tkn"
34-
TKN_VERSION=0.20.0
34+
TKN_VERSION=0.41.0
3535
# Get the tar.xz
36-
curl -LO https://github.com/tektoncd/cli/releases/download/v$TKN_VERSION/tkn_$TKN_VERSION_Linux_x86_64.tar.gz
36+
curl -LO https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz
3737
# Extract tkn to your PATH (e.g. /usr/local/bin)
38-
tar xvzf tkn_$TKN_VERSION_Linux_x86_64.tar.gz -C /usr/local/bin/ tkn
38+
tar xvzf tkn_${TKN_VERSION}_Linux_x86_64.tar.gz -C /usr/local/bin/ tkn
3939
}
4040

4141
function install_pipeline_crd() {

test/e2e-tests.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,24 @@
1717
# This script calls out to scripts in tektoncd/plumbing to setup a cluster
1818
# and deploy Tekton Pipelines to it for running integration tests.
1919

20+
SKIP_INITIALIZE=${SKIP_INITIALIZE:="false"}
21+
export GCE_METADATA_HOST=${GCE_METADATA_HOST:="localhost"}
22+
2023
export namespace="${NAMESPACE:-tekton-chains}"
2124
echo "Using namespace: $namespace"
2225

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

2528
# Script entry point.
26-
27-
initialize $@
29+
if [ "${SKIP_INITIALIZE}" != "true" ]; then
30+
initialize $@
31+
fi
2832

2933
header "Setting up environment"
3034

3135
# Test against nightly instead of latest.
3236
install_tkn
3337

34-
export RELEASE_YAML="https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.62.0/release.yaml"
35-
install_pipeline_crd
36-
3738
install_chains
3839

3940
install_spire
@@ -44,6 +45,8 @@ chains_patch_spire
4445

4546
failed=0
4647

48+
go install github.com/jstemmer/go-junit-report/v2@latest
49+
4750
# Run the integration tests
4851
header "Running Go e2e tests"
4952
go_test_e2e -timeout=35m ./test/... || failed=1

0 commit comments

Comments
 (0)