seanghaeli commented on code in PR #74399:
URL: https://github.com/apache/airflow/pull/74399#discussion_r4291715024


##########
providers/amazon/tests/unit/amazon/aws/executors/eks/test_eks_executor.py:
##########
@@ -0,0 +1,154 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import importlib
+import os
+import sys
+from unittest import mock
+
+import pytest
+from kubernetes.client import CoreV1Api
+from kubernetes.client.rest import ApiException
+
+from airflow.providers.amazon.aws.executors.eks import AwsEksExecutor, 
_client_factory
+from airflow.providers.amazon.aws.executors.eks.eks_executor import (
+    _ASYNC_CLIENT_FACTORY_PATH,
+    _CLIENT_FACTORY_PATH,
+)
+from airflow.providers.cncf.kubernetes.executors.kubernetes_executor import 
KubernetesExecutor
+from airflow.providers.common.compat.sdk import 
AirflowOptionalProviderFeatureException, conf
+
+from tests_common.test_utils.config import conf_vars
+from tests_common.test_utils.version_compat import AIRFLOW_V_3_2_PLUS
+
+EKS_EXECUTOR_MODULE = "airflow.providers.amazon.aws.executors.eks.eks_executor"
+CLIENT_FACTORY_ENV_VAR = "AIRFLOW__KUBERNETES_EXECUTOR__CLIENT_FACTORY"
+TEAMS = [
+    pytest.param(None, "AIRFLOW__", id="global"),
+    pytest.param(
+        "team_a",
+        "AIRFLOW__TEAM_A___",
+        id="team",
+        marks=pytest.mark.skipif(not AIRFLOW_V_3_2_PLUS, reason="Multi-team 
requires Airflow 3.2+"),
+    ),
+]
+
+
+def _team_kwargs(team_name: str | None) -> dict:
+    return {"team_name": team_name} if team_name else {}
+
+
[email protected](autouse=True)
+def eks_config():
+    with mock.patch.dict(os.environ), conf_vars({("aws_eks_executor", 
"cluster_name"): "test-eks-cluster"}):
+        for prefix in ("AIRFLOW__", "AIRFLOW__TEAM_A___"):
+            for key in ("CLIENT_FACTORY", "ASYNC_CLIENT_FACTORY"):
+                os.environ.pop(f"{prefix}KUBERNETES_EXECUTOR__{key}", None)
+        yield
+
+
+class TestAwsEksExecutor:

Review Comment:
   Similar to the above comment, `KubernetesExecutor` and `AwsEksExecutor` use 
the same cluster for all teams as of right now. I will deal with that 
limitation as a follow-on, described by the issue 
https://github.com/apache/airflow/issues/74844 and then I will add these tests.



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