-
Notifications
You must be signed in to change notification settings - Fork 170
95 lines (90 loc) · 3.18 KB
/
e2e-test.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
---
name: "Create cluster using KinD"
on:
workflow_dispatch: {}
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: "Build:checkout"
uses: actions/checkout@v2
- name: "Build:buildx"
uses: docker/setup-buildx-action@v1
with:
version: v0.9.1 # Buildx version
- name: "Build:login"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.controller
push: true
build-args: |
GO_BUILDER_IMG=golang:1.21
tags: |
ghcr.io/grafana/k6-operator:${{ github.sha }}
kind-kustomize:
needs: ["docker"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "Kustomize Build"
uses: karancode/kustomize-github-action@master
with:
kustomize_version: "3.0.0"
kustomize_build_dir: "config/default"
kustomize_output_file: "rendered.yaml"
kustomize_build_options: "--load_restrictor none"
- uses: engineerd/[email protected]
with:
version: "v0.20.0"
image: "kindest/node:v1.27.1"
- name: Testing
run: |
kubectl cluster-info
kubectl cluster-info dump | grep 'nodeInfo' -A 11
kubectl apply -f rendered.yaml
kubectl -n k6-operator-system set image deployment/k6-operator-controller-manager manager=ghcr.io/grafana/k6-operator:${{ github.sha }}
kubectl -n k6-operator-system describe deployment k6-operator-controller-manager
kubectl create configmap crocodile-stress-test --from-file e2e/test.js
kubectl apply -f e2e/test.yaml
sleep 30
kubectl get namespaces
kubectl get jobs -A
kubectl wait --for=condition=complete --timeout=180s job/k6-sample-initializer
kubectl delete configmap crocodile-stress-test
kubectl delete -f e2e/test.yaml
kind-helm:
needs: ["docker"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.7.2
- name: Create kind cluster
uses: helm/[email protected]
with:
node_image: "kindest/node:v1.27.1"
- name: Testing
run: |
helm install k6-operator ./charts/k6-operator/ -f ./charts/k6-operator/values.yaml --set manager.image.tag=${{github.sha}}
kubectl cluster-info dump | grep 'nodeInfo' -A 11
kubectl -n k6-operator-system describe deployment k6-operator-controller-manager
kubectl create configmap crocodile-stress-test --from-file e2e/test.js
kubectl apply -f e2e/test.yaml
sleep 30
kubectl get namespaces
kubectl get jobs -A
kubectl wait --for=condition=complete --timeout=180s job/k6-sample-1
kubectl delete configmap crocodile-stress-test
kubectl delete -f e2e/test.yaml