-
Notifications
You must be signed in to change notification settings - Fork 148
117 lines (101 loc) · 3.54 KB
/
e2e_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: e2e Tests
on:
pull_request:
branches:
- main
- 'incubation'
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'
push:
branches:
- main
- 'incubation'
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'
concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
QUAY_ORG: ${{ secrets.QUAY_ORG}}
IMAGE_REGISTRY: quay.io
BUNDLE_IMAGE_NAME: opendatahub-operator-bundle
IMAGE_NAME: opendatahub-operator
IMAGE_TAG: pr-${{ github.event.pull_request.number }}
OPERATOR_NAMESPACE: opendatahub-operator-system
jobs:
kubernetes-e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: ${{ env.IMAGE_REGISTRY}}
username: ${{ secrets.QUAY_ID }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Pull operator image from registry
run: |
# Pull the image from registry
while true
do
echo "Pulling image from Quay.io";
sleep 10
if docker pull quay.io/${{ env.QUAY_ORG }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
then
break
fi
done
# Build operator bundle image
# make bundle-build -e BUNDLE_IMG=quay.io/${{ env.QUAY_ORG }}/${{ env.BUNDLE_IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
# -e IMG=quay.io/${{ env.QUAY_ORG }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} IMAGE_BUILDER=${{env.IMAGE_BUILDER}}
- name: Setup and start KinD cluster
uses: ./.github/actions/kind
- name: Verify KinD
run: |
kind get clusters
kubectl get nodes -o wide
- name: Load Image in KinD cluster
run: |
kind load docker-image quay.io/${{ env.QUAY_ORG }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} --name kind-cluster
docker exec -t kind-cluster-control-plane crictl images
- name: Create Namespace for ODHO
run: |
kubectl create namespace ${{env.OPERATOR_NAMESPACE}}
kubectl config set-context --current --namespace=$${{env.OPERATOR_NAMESPACE}}
- name: Deploy Operatorhub operator
id: deploy
run: |
echo Deploying Operatorhub operator
IMG=quay.io/${{ env.QUAY_ORG }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
kubectl config use-context kind-kind-cluster
make deploy -e IMG=$IMG OPERATOR_NAMESPACE=${{env.OPERATOR_NAMESPACE}} IMAGE_BUILDER=${{env.IMAGE_BUILDER}}
- name: Wait for ODHO deployment
run: |
echo "Get pods"
kubectl get pods -A
echo "Log describe"
kubectl describe pods -n ${{env.OPERATOR_NAMESPACE}}
echo "Get replicasets"
kubectl get replicasets -n ${{env.OPERATOR_NAMESPACE}}
echo "Get events"
kubectl get events -n ${{env.OPERATOR_NAMESPACE}}
kubectl wait -n ${{ env.OPERATOR_NAMESPACE}} --timeout=5m --for=condition=Available=true deployment opendatahub-operator-controller-manager
- name: Run e2e tests
run: |
make e2e-test OPERATOR_NAMESPACE=${{env.OPERATOR_NAMESPACE}}
- name: Clean up KinD cluster
run: |
kind delete cluster --name kind-cluster