-
Notifications
You must be signed in to change notification settings - Fork 3
199 lines (158 loc) · 5.46 KB
/
install-tests.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
on:
workflow_dispatch:
name: Test installer
jobs:
#
# GNU/Linux
#
tests-on-gnu-linux:
runs-on: ubuntu-latest
strategy:
# Keep running even if one variation of the job fail
fail-fast: false
#
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
# Tests if the install script checks ok
- name: Test install-magasin.sh -c (dependencies installed)
run: |
cd installer
./install-magasin.sh -c
cd ..
# This action also installs helm
- name: Start a local k8s cluster
uses: jupyterhub/action-k3s-helm@v3
with:
k3s-channel: latest
metrics-enabled: false
traefik-enabled: false
docker-enabled: false
# Run local Helm repo with the branch helm charts
- name: Run local repo
run: |
pwd
cd helm-scripts
./local-helm-repo.sh
sleep 10
cd ..
# TODO remove
- name: TEST install only dagster
run: |
helm version
#cd helm-scripts
#./update-helm-charts.sh
# Run repo again
#./local-helm-repo.sh &
#cd ..
# is it in the package action?
helm install dagster ./helm/dagster --namespace dagter-file --create-namespace
# Test reindexing without existing index?
#helm repo index /home/runner/work/magasin/magasin/_helm-repo --url http://localhost:8000
helm repo add mgs http://localhost:8000
helm install dagster mgs/dagster -n dag --create-namespace
- name: Remove kubectl and helm
run: |
whereis kubectl
whereis helm
dpkg -s kubectl
sudo apt-get remove -y kubectl
sudo rm /usr/local/bin/helm
# Tests if the script checks ok
- name: Test install-magasin.sh -c (check with dependencies missing)
run: |
cd installer
./install-magasin.sh -c
cd ..
# Tests if the script installs pedendencies ok
- name: Test install-magasin.sh -i (install with dependencies missing)
run: |
cd installer
./install-magasin.sh -i -y
# Double test dependencies were installed
helm version
kubectl
- name: Verify function of k8s, kubectl, and helm
run: |
echo "kubeconfig: $KUBECONFIG"
kubectl version
kubectl get pods --all-namespaces
helm version
helm list
# Check new paths
whereis helm
whereis kubectl
- name: Install magasin from local repo
run: |
# Now we install magasin
cd installer
# We will test that yaml files overwrite
echo "drill: " > drill.yaml
echo " count: 1" >> drill.yaml
# We use the local repo and we test that the prefix and postfix work
./install-magasin.sh -u http://localhost:8000 -r mgs-test
# For local inspection
kubectl get pods --all-namespaces
# Display if have been installed
helm list -n mgs-drill-test
helm list -n mgs-dagster-test
helm list -n mgs-daskhub-test
helm list -n mgs-operator-test
helm list -n mgs-tenant-test
helm list -n mgs-superset-test
# Execute the helm command and count the number of charts
# We have installed 6 charts + one header line == 7 lines
num_lines=$(helm list --all-namespaces | wc -l)
# Check if the number of lines is not equal to 7
if [ "$num_lines" -ne 7 ]; then
echo "Error: The command 'helm list --all-namespaces' did not return 7 lines of output."
exit 1
fi
# Check if any line contains 'failed'
if helm list --all-namespaces | grep -q "failed"; then
echo "Error: One or more components have failed status."
exit 1
fi
#
# UNINSTALLER tests GNU/Linux
#
# Test if the script tests
- name: Test uninstall-magasin.sh -c
run: |
cd installer
./uninstall-magasin.sh -c
# Test if the script tests
- name: Test uninstall-magasin.sh -r mgs-test
run: |
cd installer
./uninstall-magasin.sh -r mgs-test
# namespaces should not exist anymore
kubectl get namespaces
#
# INSTALLER | MacOS
#
tests-on-macos:
runs-on: macos-latest # Specifies the macOS runner
strategy:
# Keep running even if one variation of the job fail
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v2 # Action to checkout your repository's code
- name: Test install-magasin.sh -c (check dependencies)
run: |
cd installer
zsh ./install-magasin.sh -c
- name: Test install-magasin.sh -i (install dependencies)
run: |
cd installer
zsh ./install-magasin.sh -i -y
# Note that we're not testing the setup in a kubernetes cluster.
# Test uninstall
- name: Test uninstall-magasin.sh -c
run: |
cd installer
zsh ./install-magasin.sh -c
zsh ./uninstall-magasin.sh -c