SameerMesiah97 commented on code in PR #64164:
URL: https://github.com/apache/airflow/pull/64164#discussion_r2985262816


##########
helm-tests/tests/helm_tests/airflow_aux/test_database_cleanup.py:
##########
@@ -508,3 +508,15 @@ def test_overridden_automount_service_account_token(self):
             
show_only=["templates/database-cleanup/database-cleanup-serviceaccount.yaml"],
         )
         assert jmespath.search("automountServiceAccountToken", docs[0]) is 
False
+
+    def test_ttl_seconds_after_finished_is_configurable(self):
+        docs = render_chart(
+            values={
+                "databaseCleanup": {
+                    "enabled": True,
+                    "ttlSecondsAfterFinished": 300,
+                }
+            },
+            
show_only=["templates/database-cleanup/database-cleanup-cronjob.yaml"],
+        )
+        assert 
jmespath.search("spec.jobTemplate.spec.ttlSecondsAfterFinished", docs[0]) == 300

Review Comment:
   Test appears to cover the happy path but it does not really validate the 
conditional rendering. I think we should also cover `null/unset` and `value = 
0`. Otherwise it is quite easy to break the templating logic without this test 
catching it.



##########
chart/templates/database-cleanup/database-cleanup-cronjob.yaml:
##########
@@ -56,6 +56,9 @@ spec:
   jobTemplate:
     spec:
       backoffLimit: 1
+      {{- if not (kindIs "invalid" 
.Values.databaseCleanup.ttlSecondsAfterFinished) }}

Review Comment:
   Is kindIs "invalid" needed here? My understanding is that the schema is 
already enforcing integer/null/



-- 
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