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


##########
helm-tests/tests/helm_tests/airflow_aux/test_database_cleanup.py:
##########
@@ -507,3 +507,28 @@ 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
+
+    @pytest.mark.parametrize(
+        ("ttl_value", "expected_rendered"),
+        [
+            (300, 300),
+            (0, 0),
+            (None, None),
+        ],
+    )
+    def test_ttl_seconds_after_finished_rendering(self, ttl_value, 
expected_rendered):
+        values = {"databaseCleanup": {"enabled": True}}
+        if ttl_value is not None:
+            values["databaseCleanup"]["ttlSecondsAfterFinished"] = ttl_value
+
+        docs = render_chart(
+            values=values,
+            
show_only=["templates/database-cleanup/database-cleanup-cronjob.yaml"],
+        )
+
+        actual_ttl = 
jmespath.search("spec.jobTemplate.spec.ttlSecondsAfterFinished", docs[0])
+
+        if expected_rendered is not None:
+            assert actual_ttl == expected_rendered
+        else:
+            assert "ttlSecondsAfterFinished" not in 
docs[0]["spec"]["jobTemplate"]["spec"]

Review Comment:
   Could we separate this test to two tests:
   1. first for testing not setting the value (so default behaviour)
   2. second for testing different values
   
   ?



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