From 3bdcb0d4ffc7754e91b6af49739d85db8d14b5d1 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Thu, 15 Aug 2024 16:36:56 +0000 Subject: [PATCH] chart(fix): [regression] Able to disable tracing via config key tracing.enabled Fixes: https://github.com/SeleniumHQ/docker-selenium/issues/2355 Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/templates/logging-configmap.yaml | 2 +- tests/charts/templates/test.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/selenium-grid/templates/logging-configmap.yaml b/charts/selenium-grid/templates/logging-configmap.yaml index 72afb6e8c..d1c090696 100644 --- a/charts/selenium-grid/templates/logging-configmap.yaml +++ b/charts/selenium-grid/templates/logging-configmap.yaml @@ -15,8 +15,8 @@ data: SE_LOG_LEVEL: {{ default "INFO" .Values.global.seleniumGrid.logLevel | quote }} SE_STRUCTURED_LOGS: {{ default false .Values.global.seleniumGrid.structuredLogs | quote }} SE_HTTP_LOGS: {{ default false .Values.global.seleniumGrid.httpLogs | quote }} + SE_ENABLE_TRACING: {{ eq (include "seleniumGrid.enableTracing" $) "true" | ternary "true" "false" | quote }} {{- if (eq (include "seleniumGrid.enableTracing" .) "true") }} - SE_ENABLE_TRACING: "true" SE_OTEL_TRACES_EXPORTER: {{ .Values.tracing.exporter | quote }} SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED: {{ .Values.tracing.globalAutoConfigure | quote }} SE_OTEL_EXPORTER_ENDPOINT: {{ tpl .Values.tracing.exporterEndpoint $ | quote }} diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index c729bbb38..26344561c 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -241,6 +241,16 @@ def test_enable_leftovers_cleanup(self): count += 1 self.assertEqual(count, len(resources_name), "No node config resources found") + def test_enable_tracing(self): + resources_name = ['{0}selenium-logging-config'.format(RELEASE_NAME)] + count = 0 + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap': + logger.info(f"Assert ENV vars for Tracing disabled is set to Node ConfigMap") + self.assertEqual(doc['data']['SE_ENABLE_TRACING'], 'false') + count += 1 + self.assertEqual(count, len(resources_name), "No node config resources found") + if __name__ == '__main__': failed = False try: