jedcunningham commented on code in PR #24220:
URL: https://github.com/apache/airflow/pull/24220#discussion_r910477643


##########
tests/charts/test_keda.py:
##########
@@ -52,6 +52,50 @@ def test_keda_enabled(self, executor, is_created):
         else:
             assert docs == []
 
+    @parameterized.expand(
+        [
+            ('CeleryExecutor'),
+            ('CeleryKubernetesExecutor'),
+        ]
+    )
+    def test_keda_advanced(self, executor):
+        """
+        Verify keda advanced config.
+        """
+        expected_advanced = {
+            "horizontalPodAutoscalerConfig": {
+                "behavior": {
+                    "scaleDown": {
+                        "stabilizationWindowSeconds": 300,
+                        "policies": [{"type": "Percent", "value": 100, 
"periodSeconds": 15}],
+                    }
+                }
+            }
+        }
+        docs = render_chart(
+            values={
+                "workers": {
+                    "keda": {
+                        "enabled": True,
+                        "advanced": {
+                            "horizontalPodAutoscalerConfig": {
+                                "behavior": {
+                                    "scaleDown": {
+                                        "stabilizationWindowSeconds": 300,
+                                        "policies": [{"type": "Percent", 
"value": 100, "periodSeconds": 15}],
+                                    }
+                                }
+                            }
+                        },
+                    },
+                    "persistence": {"enabled": False},
+                },
+                'executor': executor,

Review Comment:
   ```suggestion
                   "executor": executor,
   ```
   
   Nit: lets keep consistent quotes.



##########
tests/charts/test_keda.py:
##########
@@ -52,6 +52,50 @@ def test_keda_enabled(self, executor, is_created):
         else:
             assert docs == []
 
+    @parameterized.expand(
+        [
+            ('CeleryExecutor'),
+            ('CeleryKubernetesExecutor'),
+        ]
+    )
+    def test_keda_advanced(self, executor):
+        """
+        Verify keda advanced config.
+        """
+        expected_advanced = {
+            "horizontalPodAutoscalerConfig": {
+                "behavior": {
+                    "scaleDown": {
+                        "stabilizationWindowSeconds": 300,
+                        "policies": [{"type": "Percent", "value": 100, 
"periodSeconds": 15}],
+                    }
+                }
+            }
+        }
+        docs = render_chart(
+            values={
+                "workers": {
+                    "keda": {
+                        "enabled": True,
+                        "advanced": {
+                            "horizontalPodAutoscalerConfig": {
+                                "behavior": {
+                                    "scaleDown": {
+                                        "stabilizationWindowSeconds": 300,
+                                        "policies": [{"type": "Percent", 
"value": 100, "periodSeconds": 15}],
+                                    }
+                                }
+                            }
+                        },

Review Comment:
   ```suggestion
                           "advanced": expected_advanced,
   ```
   
   Might as well cut down on duplication.



##########
tests/charts/test_keda.py:
##########
@@ -52,6 +52,50 @@ def test_keda_enabled(self, executor, is_created):
         else:
             assert docs == []
 
+    @parameterized.expand(
+        [
+            ('CeleryExecutor'),
+            ('CeleryKubernetesExecutor'),
+        ]
+    )
+    def test_keda_advanced(self, executor):
+        """
+        Verify keda advanced config.
+        """
+        expected_advanced = {
+            "horizontalPodAutoscalerConfig": {
+                "behavior": {
+                    "scaleDown": {
+                        "stabilizationWindowSeconds": 300,
+                        "policies": [{"type": "Percent", "value": 100, 
"periodSeconds": 15}],
+                    }
+                }
+            }
+        }
+        docs = render_chart(
+            values={
+                "workers": {
+                    "keda": {
+                        "enabled": True,
+                        "advanced": {
+                            "horizontalPodAutoscalerConfig": {
+                                "behavior": {
+                                    "scaleDown": {
+                                        "stabilizationWindowSeconds": 300,
+                                        "policies": [{"type": "Percent", 
"value": 100, "periodSeconds": 15}],
+                                    }
+                                }
+                            }
+                        },
+                    },
+                    "persistence": {"enabled": False},

Review Comment:
   ```suggestion
   ```
   
   We don't need this, right?



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