This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8d4977abaf6 test(k8s): remove duplicate args in pytest runs of 
'kubernetes_tests' (#48616)
8d4977abaf6 is described below

commit 8d4977abaf6ef2096f8a275d5f4587002d7e70b2
Author: Mikhail Dengin <[email protected]>
AuthorDate: Tue Apr 1 17:34:36 2025 +0200

    test(k8s): remove duplicate args in pytest runs of 'kubernetes_tests' 
(#48616)
---
 dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py 
b/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py
index 5636a5f4c35..522f2513082 100644
--- a/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py
@@ -23,6 +23,7 @@ import shutil
 import sys
 import tempfile
 from copy import deepcopy
+from itertools import chain
 from pathlib import Path
 from shlex import quote
 
@@ -1474,8 +1475,10 @@ def _run_tests(
             f"[info]You can deploy airflow with {executor} by 
running:[/]\nbreeze k8s configure-cluster\nbreeze k8s deploy-airflow 
--multi-namespace-mode --executor {executor}"
         )
         return 1, f"Tests {kubectl_cluster_name}"
+    pytest_cmd = ["python3", "-m", "pytest"]
     the_tests: list[str] = ["kubernetes_tests/"]
-    command_to_run = " ".join([quote(arg) for arg in ["python3", "-m", 
"pytest", *the_tests, *test_args]])
+    ordered_unique_args = dict.fromkeys(chain(pytest_cmd, the_tests, 
test_args))
+    command_to_run = " ".join(quote(arg) for arg in ordered_unique_args)
     get_console(output).print(f"[info] Command to run:[/] {command_to_run}")
     result = run_command(
         [shell_binary, *extra_shell_args, "-c", command_to_run],

Reply via email to