Skip to content

Commit 0ff66b2

Browse files
authored
Run e2e tests on microshift (#1383)
1 parent dbdb211 commit 0ff66b2

File tree

3 files changed

+67
-79
lines changed

3 files changed

+67
-79
lines changed

.github/workflows/test-on-crc.yaml

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test Chains on Microshift
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
tekton-chains-e2e-tests-microshift:
20+
name: Run E2E Tests on Microshift
21+
runs-on: ubuntu-24.04
22+
strategy:
23+
fail-fast: false
24+
25+
env:
26+
SHELL: /bin/bash
27+
GOPATH: ${{ github.workspace }}
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
with:
33+
path: ${{ github.workspace }}/src/github.com/tektoncd/chains
34+
35+
- uses: imjasonh/[email protected]
36+
37+
- name: Set up Go
38+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
39+
with:
40+
cache-dependency-path: "${{ github.workspace }}/src/github.com/tektoncd/chains/go.sum"
41+
go-version-file: "${{ github.workspace }}/src/github.com/tektoncd/chains/go.mod"
42+
43+
- name: setup microshift
44+
run: |
45+
curl -L -o minc https://github.com/minc-org/minc/releases/latest/download/minc_linux_amd64
46+
chmod +x minc
47+
./minc config set provider docker
48+
./minc create --log-level debug
49+
50+
- name: Install Tekton Chains and Run e2e tests
51+
working-directory: ${{ github.workspace }}/src/github.com/tektoncd/chains
52+
53+
run: |
54+
wget https://github.com/okd-project/okd/releases/download/4.19.0-okd-scos.6/openshift-client-linux-amd64-rhel9-4.19.0-okd-scos.6.tar.gz
55+
tar -xzvf openshift-client-linux-amd64-rhel9-4.19.0-okd-scos.6.tar.gz
56+
export PATH=${PATH}:${PWD}
57+
58+
oc adm policy add-scc-to-user anyuid -z tekton-pipelines-controller
59+
oc adm policy add-scc-to-user anyuid -z tekton-pipelines-webhook
60+
61+
export KUBECONFIG=$HOME/.kube/config
62+
63+
source ${{ github.workspace }}/src/github.com/tektoncd/chains/test/crc_test.sh

test/crc_test.sh

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -e
23

34
export namespace="${NAMESPACE:-tekton-chains}"
45

@@ -20,7 +21,7 @@ function install_chains() {
2021
export KO_DOCKER_REPO=ttl.sh
2122
ko apply -f config/ || fail_test "Tekton Chains installation failed"
2223
ko resolve -f config > release.yaml
23-
yq 'del(.spec.template.spec.containers[].securityContext.runAsUser, .spec.template.spec.containers[].securityContext.runAsGroup)' release.yaml | oc apply -f -
24+
yq 'del(.spec.template.spec.containers[]?.securityContext.runAsUser, .spec.template.spec.containers[]?.securityContext.runAsGroup)' release.yaml | kubectl apply -f -
2425

2526
# Wait for pods to be running in the namespaces we are deploying to
2627
wait_until_pods_running ${namespace} || fail_test "Tekton Chains did not come up"
@@ -155,7 +156,7 @@ function wait_until_pods_running() {
155156
return 1
156157
}
157158

158-
curl https://storage.googleapis.com/tekton-releases/pipeline/latest/release.notags.yaml | yq 'del(.spec.template.spec.containers[].securityContext.runAsUser, .spec.template.spec.containers[].securityContext.runAsGroup)' | oc apply -f -
159+
curl https://storage.googleapis.com/tekton-releases/pipeline/latest/release.notags.yaml | yq 'del(.spec.template.spec.containers[]?.securityContext.runAsUser, .spec.template.spec.containers[]?.securityContext.runAsGroup)' | kubectl apply -f -
159160

160161
start_registry
161162

@@ -169,4 +170,4 @@ chains_patch_spire
169170

170171
export GCE_METADATA_HOST=localhost
171172
export OPENSHIFT=localhost
172-
go test -v -count=1 -tags=e2e -timeout=35m ./test/... --kubeconfig $HOME/.crc/machines/crc/kubeconfig
173+
go test -v -count=1 -tags=e2e -timeout=35m ./test/... --kubeconfig ${KUBECONFIG}

0 commit comments

Comments
 (0)