Skip to content

Commit

Permalink
K8s: Node template handle hpa.platformName different with default i…
Browse files Browse the repository at this point in the history
…n `values.yaml`

Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Jan 3, 2025
1 parent 710783e commit da7612b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ template:
{{- end }}
{{- if and (eq (include "seleniumGrid.useKEDA" $) "true") }}
- name: SE_NODE_PLATFORM_NAME
value: {{ default "Linux" .node.hpa.platformName | quote }}
value: {{ default "" .node.hpa.platformName | quote }}
{{- end }}
- name: SE_NODE_CONTAINER_NAME
valueFrom:
Expand Down
16 changes: 2 additions & 14 deletions tests/charts/make/chart_build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
#!/bin/bash
set -x
set -o xtrace

SET_VERSION=${SET_VERSION:-"true"}
CHART_PATH=${CHART_PATH:-"charts/selenium-grid"}
# Function to be executed on command failure
on_failure() {
local exit_status=$?
echo "There is step failed with exit status $exit_status"
exit $exit_status
}

# Trap ERR signal and call on_failure function
trap 'on_failure' ERR

cd tests || true

Expand All @@ -21,12 +12,9 @@ if [ "${CI:-false}" = "false" ]; then
source docker-selenium-tests/bin/activate
else
export PATH=$PATH:/home/$USER/.local/bin
pip3 install -U yamale yamllint
fi

python3 -m pip install yamale==4.0.4 \
yamllint==1.33.0 \
| grep -v 'Requirement already satisfied' || true
python3 -m pip install -r requirements.txt | grep -v 'Requirement already satisfied'

cd ..
rm -rf ${CHART_PATH}/Chart.lock
Expand Down
4 changes: 4 additions & 0 deletions tests/charts/templates/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ def test_scaler_triggers_parameter_nodeMaxSessions_global_and_individual_value(s
for env in doc['spec']['template']['spec']['containers'][0]['env']:
if env['name'] == 'SE_NODE_MAX_SESSIONS':
self.assertTrue(env['value'] == str(resources_name[doc['metadata']['name']]), "Value is not matched")
if env['name'] == 'SE_NODE_PLATFORM_NAME':
self.assertTrue(env['value'] == "", "Platform name is not matched")
if env['name'] == 'SE_NODE_BROWSER_VERSION':
self.assertTrue(env['value'] == "", "Browser version is not matched")
count += 1
self.assertEqual(count, len(resources_name.keys()), f"Expected {len(resources_name.keys())} resources but found {count}")

Expand Down
2 changes: 2 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ requests
chardet
csv2md
selenium
yamale
yamllint

0 comments on commit da7612b

Please sign in to comment.