Skip to content

Commit e1c4f17

Browse files
committed
test(chart): test template from chart package tgz
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 5b5f17a commit e1c4f17

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

tests/charts/bootstrap.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ python -m pip install pyyaml==6.0.1 \
1313

1414
cd ..
1515

16+
helm package charts/selenium-grid --version 1.0.0-SNAPSHOT -d tests/tests
17+
1618
RELEASE_NAME="selenium"
1719

1820
helm template ${RELEASE_NAME} --values tests/charts/templates/render/dummy.yaml \
1921
--set-file 'nodeConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
2022
--set-file 'recorderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
2123
--set-file 'uploaderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
22-
charts/selenium-grid > ./tests/tests/dummy_template_manifests.yaml
24+
tests/tests/selenium-grid-1.0.0-SNAPSHOT.tgz > ./tests/tests/dummy_template_manifests.yaml
2325

2426
python tests/charts/templates/test.py "./tests/tests/dummy_template_manifests.yaml" ${RELEASE_NAME}
2527
if [ $? -ne 0 ]; then
@@ -30,14 +32,15 @@ fi
3032
rm -rf tests/charts/umbrella-charts/Chart.lock tests/charts/umbrella-charts/charts
3133
helm dependency update tests/charts/umbrella-charts
3234
helm dependency build tests/charts/umbrella-charts
35+
helm package tests/charts/umbrella-charts --version 1.0.0-SNAPSHOT -d tests/tests
3336

3437
RELEASE_NAME="test"
3538

3639
helm template ${RELEASE_NAME} --values tests/charts/templates/render/dummy_solution.yaml \
3740
--set-file 'selenium-grid.nodeConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
3841
--set-file 'selenium-grid.recorderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
3942
--set-file 'selenium-grid.uploaderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
40-
tests/charts/umbrella-charts > ./tests/tests/dummy_solution_template_manifests.yaml
43+
tests/tests/umbrella-charts-1.0.0-SNAPSHOT.tgz > ./tests/tests/dummy_solution_template_manifests.yaml
4144

4245
python tests/charts/templates/test.py "./tests/tests/dummy_solution_template_manifests.yaml" ${RELEASE_NAME}
4346
if [ $? -ne 0 ]; then

tests/charts/templates/test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ def test_extra_script_import_to_node_configmap(self):
154154
for doc in LIST_OF_DOCUMENTS:
155155
if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap':
156156
logger.info(f"Assert default file is imported to Node ConfigMap")
157-
self.assertTrue(doc['data']['nodeProbe.sh'] is not None)
158-
self.assertTrue(doc['data']['nodePreStop.sh'] is not None)
159-
self.assertTrue(doc['data']['nodeCustomTask.sh'] is not None)
160-
self.assertTrue(doc['data']['setFromCommand.sh'] is not None)
157+
self.assertTrue(doc['data']['nodeProbe.sh'] != "")
158+
self.assertTrue(doc['data']['nodePreStop.sh'] != "")
159+
self.assertTrue(doc['data']['nodeCustomTask.sh'] != "")
160+
self.assertTrue(doc['data']['setFromCommand.sh'] != "")
161161
count += 1
162162
self.assertEqual(count, len(resources_name), "No node config resources found")
163163

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
global:
2+
seleniumGrid:
3+
imageRegistry: selenium
4+
5+
selenium-grid:
6+
enabled: true

0 commit comments

Comments
 (0)