Skip to content

Commit 58b07e1

Browse files
committed
Improve helm checking
Signed-off-by: Gavin Halliday <[email protected]>
1 parent bb52776 commit 58b07e1

File tree

2 files changed

+48
-16
lines changed

2 files changed

+48
-16
lines changed

.github/workflows/test-helm.yml

+47-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
name: Run helm chart tests
22

33
on:
4-
push:
5-
branches:
6-
- "master"
7-
- "candidate-*"
8-
- "!candidate-7.8.*"
9-
- "!candidate-7.6.*"
10-
- "!candidate-7.4.*"
11-
- "!candidate-7.2.*"
12-
- "!candidate-7.0.*"
13-
- "!candidate-6.*"
144
pull_request:
155
branches:
166
- "master"
@@ -38,7 +28,7 @@ jobs:
3828
name: "Check helm chart lint"
3929
runs-on: ubuntu-20.04
4030
needs: pre_job
41-
if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }}
31+
#if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }}
4232
steps:
4333
- uses: actions/checkout@v4
4434
with:
@@ -57,8 +47,50 @@ jobs:
5747
- name: Check for changes in helm output for default values
5848
working-directory: .
5949
run: |
60-
helm template helm/hpcc > ${{ runner.temp }}/newoutput.txt
61-
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ${{ github.base_ref }}
50+
resultcode=0
51+
mkdir ${{ runner.temp }}/new
52+
mkdir ${{ runner.temp }}/old
53+
54+
#Generate the output for the default values file, and each of the specialised test files.
55+
#Check to see if anything has changed between old and new, and report the differences
56+
helm template helm/hpcc > ${{ runner.temp }}/new/output.txt
57+
for file in testing/helm/tests/*.yaml
58+
do
59+
tail=$(basename $file)
60+
helm template helm/hpcc --values $file > ${{ runner.temp }}/new/$tail.txt
61+
done
62+
63+
git fetch --no-tags --prune --progress --no-recurse-submodules --quiet --depth=1 origin ${{ github.base_ref }}
64+
echo git checkout ${{ github.base_ref }}
6265
git checkout ${{ github.base_ref }}
63-
helm template helm/hpcc > ${{ runner.temp }}/oldoutput.txt
64-
diff ${{ runner.temp }}/oldoutput.txt ${{ runner.temp }}/newoutput.txt
66+
67+
helm template helm/hpcc > ${{ runner.temp }}/old/output.txt
68+
for file in testing/helm/tests/*.yaml
69+
do
70+
tail=$(basename $file)
71+
helm template helm/hpcc --values $file > ${{ runner.temp }}/old/$tail.txt
72+
done
73+
74+
diff ${{ runner.temp }}/old/output.txt ${{ runner.temp }}/new/output.txt
75+
if [ $? -ne 0 ]
76+
then
77+
resultcode=1
78+
else
79+
#Only check for differences in the specialised test files if the default values file is the same
80+
for file in testing/helm/tests/*.yaml
81+
do
82+
tail=$(basename $file)
83+
echo Check $tail
84+
diff ${{ runner.temp }}/old/$tail.txt ${{ runner.temp }}/new/$tail.txt
85+
if [ $? -ne 0 ]
86+
then
87+
resultcode=1
88+
fi
89+
echo old
90+
grep "my-dali-plane" ${{ runner.temp }}/old/$tail.txt | cat
91+
echo new
92+
grep "my-dali-plane" ${{ runner.temp }}/new/$tail.txt | cat
93+
done
94+
fi
95+
96+
exit $resultcode

testing/helm/tests/implicitplanes.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ storage:
1717
storageClass: ""
1818
forcePermissions: true
1919
category: sasha
20-
- name: my-dali-plane
20+
- name: my-dali-planexx
2121
prefix: "/var/lib/HPCCSystems/dalistorage"
2222
storageSize: 1Gi
2323
storageClass: ""

0 commit comments

Comments
 (0)