jedcunningham commented on code in PR #37365:
URL: https://github.com/apache/airflow/pull/37365#discussion_r1506777646
##########
helm_tests/airflow_core/test_triggerer.py:
##########
@@ -710,3 +710,31 @@ def test_should_use_keda_query(self, query,
expected_query):
show_only=["templates/triggerer/triggerer-kedaautoscaler.yaml"],
)
assert expected_query ==
jmespath.search("spec.triggers[0].metadata.query", docs[0])
+
+ def test_should_use_keda_queryValue(self):
+ docs = render_chart(
+ values={
+ "data": {"metadataConnection": {"protocol": "mysql"}},
+ "triggerer": {
+ "enabled": True,
+ "keda": {"enabled": True},
+ },
+ },
+ show_only=["templates/triggerer/triggerer-kedaautoscaler.yaml"],
+ )
+ assert "1" == jmespath.search("spec.triggers[0].metadata.queryValue",
docs[0])
+ assert jmespath.search("spec.triggers[0].metadata.targetQueryValue",
docs[0]) is None
+
+ def test_should_use_connectionStringFromEnv(self):
+ docs = render_chart(
+ values={
+ "data": {"metadataConnection": {"protocol": "mysql"}},
+ "triggerer": {
+ "enabled": True,
+ "keda": {"enabled": True},
+ },
+ },
+ show_only=["templates/triggerer/triggerer-kedaautoscaler.yaml"],
+ )
+ assert "KEDA_DB_CONN" ==
jmespath.search("spec.triggers[0].metadata.connectionStringFromEnv", docs[0])
+ assert jmespath.search("spec.triggers[0].metadata.connectionFromEnv",
docs[0]) is None
Review Comment:
Can you roll these into the above test (maybe rename it to something like
`test_mysql_keda_trigger` or something)? Each of these tests aren't exactly
"cheap" as they do a call out to helm, and they add up en mass.
--
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]