-
Notifications
You must be signed in to change notification settings - Fork 218
82 lines (72 loc) · 2.88 KB
/
functional-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
name: Functional tests
on: [pull_request]
jobs:
operator:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.19'
- uses: nolar/setup-k3d-k3s@v1
with:
version: v1.22
k3d-name: opensearch-operator-tests
k3d-args: --agents 2 -p 30000-30005:30000-30005@agent:0
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
set -e
export CLUSTER_NAME=opensearch-operator-tests
## Check disk to avoid failed shard assignments due to watermarking
df -h
cd opensearch-operator
## Prepare kubeconfig
k3d kubeconfig get $CLUSTER_NAME > functionaltests/kubeconfig
export KUBECONFIG=$(pwd)/functionaltests/kubeconfig
## Build controller docker image
make docker-build
## Import controller docker image
k3d image import -c $CLUSTER_NAME controller:latest
## Install helm chart
helm install opensearch-operator ../charts/opensearch-operator --set manager.image.repository=controller --set manager.image.tag=latest --set manager.image.pullPolicy=IfNotPresent --namespace default --wait
cd functionaltests
## Run tests
go test ./operatortests -timeout 30m
cluster-helm-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.19'
- uses: nolar/setup-k3d-k3s@v1
with:
version: v1.22
k3d-name: opensearch-operator-tests
k3d-args: --agents 2 -p 30000-30005:30000-30005@agent:0
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
set -e
export CLUSTER_NAME=opensearch-operator-tests
## Check disk to avoid failed shard assignments due to watermarking
df -h
cd opensearch-operator
## Prepare kubeconfig
k3d kubeconfig get $CLUSTER_NAME > functionaltests/kubeconfig
export KUBECONFIG=$(pwd)/functionaltests/kubeconfig
## Build controller docker image
make docker-build
## Import controller docker image
k3d image import -c $CLUSTER_NAME controller:latest
## Install helm chart
helm install opensearch-operator ../charts/opensearch-operator --set manager.image.repository=controller --set manager.image.tag=latest --set manager.image.pullPolicy=IfNotPresent --namespace default --wait
helm install opensearch-cluster ../charts/opensearch-cluster --set OpenSearchClusterSpec.enabled=true --wait
cd functionaltests
## Run tests
go test ./helmtests -timeout 15m