-
Notifications
You must be signed in to change notification settings - Fork 11
111 lines (94 loc) · 3.7 KB
/
e2e-test.yml
File metadata and controls
111 lines (94 loc) · 3.7 KB
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
name: Windup Operator E2E Tests
on: [pull_request,push]
jobs:
minikube:
name: K8S
runs-on: ubuntu-latest
strategy:
matrix:
# check versions in https://github.com/kubernetes/kubernetes/releases
kubernetes_version: [v1.19.16, v1.20.15, v1.21.14, v1.22.13, v1.23.10, v1.24.4]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Minikube-Kubernetes
# check version in https://github.com/manusa/actions-setup-minikube/releases
uses: manusa/actions-setup-minikube@v2.7.2
with:
# check version in https://github.com/kubernetes/minikube/releases
minikube version: v1.26.1
kubernetes version: ${{ matrix.kubernetes_version }}
github token: ${{ secrets.GITHUB_TOKEN }}
start args: ' --force'
- name: Setup Java 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
java-package: jdk
cache: 'maven'
- name: Build operator image and push it to the minikube docker host
run: |
cd ${{github.workspace}}
mvn clean package -Pnative -DskipTests \
-Dquarkus.native.container-build=true \
-Dquarkus.native.container-runtime=docker \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.tag=test \
-Dquarkus.container-image.push=false
minikube cache add quay.io/windupeng/windup-operator-native:test
- name: Deploy operator
run: |
cd ${{github.workspace}}
cd src/main/resources/k8s/def
kubectl apply -f windup.namespace.yaml
kubectl apply -f windup.serviceaccount.yaml
kubectl apply -f windup.role.yaml
kubectl apply -f windup.rolebinding.yaml
kubectl apply -f windup.crd.yaml
kubectl apply -f ../../../../test/resources/windup.deployment.yaml
kubectl apply -f ../../../../test/resources/windup-test.yaml
- name: Sleep for 10 seconds to allow operator to start
uses: jakejarvis/wait-action@master
with:
time: '10s'
- name: Operator Logs
run: kubectl logs --tail=-1 -l app=windup-operator -n windup
- name: Sleep for 30 seconds to allow objects to be created
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: List k8s objects on windup namespace
id: listobjects
run: kubectl get all,ing,pvc -n windup -o name
shell: bash
- name: Get and store number of k8s objects on windup namespace
id: getobjects
run: echo "::set-output name=value::$(kubectl get all,ing,pvc -n windup -o name | wc -l)"
shell: bash
- name: Operator Test
uses: therussiankid92/gat@v1.7
with:
assertion: should.equal
expected: 19
actual: ${{steps.getobjects.outputs.value}}
- name: Scale up test
run: |
cd ${{github.workspace}}
cd src/test/resources
(echo " executor_desired_replicas: 3" | cat windup-test.yaml -) | kubectl apply -f -
- name: Sleep for 5 seconds to allow objects to be created
uses: jakejarvis/wait-action@master
with:
time: '5s'
- name: List k8s pods for the executor
id: executorpods
run: echo "::set-output name=value::$(kubectl get pods -n windup -o name | grep executor | wc -l)"
shell: bash
- name: Check executor pods are the expected
uses: therussiankid92/gat@v1.7
with:
assertion: should.equal
expected: 3
actual: ${{steps.executorpods.outputs.value}}