o-nikolas commented on code in PR #61321:
URL: https://github.com/apache/airflow/pull/61321#discussion_r2766078143
##########
providers/amazon/tests/unit/amazon/aws/executors/aws_lambda/test_lambda_executor.py:
##########
@@ -1028,3 +1028,64 @@ def test_terminate(self, mock_executor,
mock_airflow_key):
"Terminating Lambda executor. In-flight tasks cannot be stopped."
)
assert len(mock_executor.running_tasks) == 1
+
+ @pytest.mark.skipif(not AIRFLOW_V_3_1_PLUS, reason="Multi-team support
requires Airflow 3.1+")
+ def test_team_config(self):
+ """Test that the executor uses team-specific configuration when
provided via self.conf."""
+ from unittest.mock import patch
+
+ # Team name to be used throughout
+ team_name = "team_a"
+ # Patch environment to include two sets of configs for the Lambda
executor. One that is related to a
+ # team and one that is not. Then we will create two executors (one
with a team and one without) and
+ # ensure the correct configs are used.
+ config_overrides = [
+
(f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllLambdaConfigKeys.FUNCTION_NAME}",
"global-function"),
+ (f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllLambdaConfigKeys.QUEUE_URL}",
"global-queue-url"),
+ (f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllLambdaConfigKeys.DLQ_URL}",
"global-dlq-url"),
+ (f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllLambdaConfigKeys.QUALIFIER}",
"global-qualifier"),
+
(f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllLambdaConfigKeys.REGION_NAME}",
"us-west-1"),
+
(f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllLambdaConfigKeys.AWS_CONN_ID}",
"aws_default"),
Review Comment:
These aren't validated below (and the team only gets region_name, not the
conn id)
--
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]