potiuk commented on a change in pull request #18974:
URL: https://github.com/apache/airflow/pull/18974#discussion_r770139457



##########
File path: chart/tests/test_airflow_common.py
##########
@@ -130,3 +130,78 @@ def test_should_set_correct_helm_hooks_weight(self):
         )
         annotations = jmespath.search("metadata.annotations", docs[0])
         assert annotations["helm.sh/hook-weight"] == "0"
+
+    def test_should_disable_some_variables(self):
+        docs = render_chart(
+            values={
+                "enableBuiltInSecretVariables": {
+                    "AIRFLOW_CORE_FERNET_KEY": True,
+                    "AIRFLOW__CORE__SQL_ALCHEMY_CONN": False,
+                    "AIRFLOW_CONN_AIRFLOW_DB": True,
+                    "AIRFLOW__WEBSERVER__SECRET_KEY": False,
+                    "AIRFLOW__CELERY__CELERY_RESULT_BACKEND": True,
+                    "AIRFLOW__CELERY__RESULT_BACKEND": False,
+                    "AIRFLOW__CELERY__BROKER_URL": True,
+                    "AIRFLOW__ELASTICSEARCH__HOST": False,
+                    "AIRFLOW__ELASTICSEARCH__ELASTICSEARCH_HOST": True,
+                },
+            },
+            show_only=[
+                "templates/scheduler/scheduler-deployment.yaml",
+                "templates/workers/worker-deployment.yaml",
+                "templates/webserver/webserver-deployment.yaml",
+                "templates/triggerer/triggerer-deployment.yaml",
+            ],
+        )
+        expected_vars = [
+            'AIRFLOW__CORE__FERNET_KEY',
+            'AIRFLOW_CONN_AIRFLOW_DB',
+            'AIRFLOW__CELERY__CELERY_RESULT_BACKEND',
+            'AIRFLOW__CELERY__BROKER_URL',
+        ]
+        expected_vars_in_worker = ['DUMB_INIT_SETSID'] + expected_vars
+        for doc in docs:
+            component = doc['metadata']['labels']['component']
+            variables = expected_vars_in_worker if component == 'worker' else 
expected_vars
+            assert variables == jmespath.search(
+                "spec.template.spec.containers[0].env[*].name", doc
+            ), f"Wrong vars in {component}"
+
+    def test_have_all_variables(self):
+        docs = render_chart(
+            values={
+                "enableBuiltInSecretVariables": {

Review comment:
       No: ) 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to