From 4b0c512d650993afd42024c757a659d8ab6926bb Mon Sep 17 00:00:00 2001 From: xiaodu55 <1704788159@qq.com> Date: Sun, 4 Oct 2026 17:04:17 +0800 Subject: [PATCH] test(deploy): recognize the Docker CLI as docker.exe in the real_docker fixture (#6262) Path(client).name == "docker" misses the Windows CLI (docker.EXE), so every real-compose test routed through the standalone-Compose wrapper, whose shift strips the compose subcommand; the root CLI then rejected the script's --env-file probe with "unknown flag: --env-file". Compare the stem instead so the CLI is recognized on Windows too. Root cause identified by @xihongshichaojidan8 in #6259. Fixes #6261 Co-authored-by: xiaodu55 --- backend/tests/test_deploy_dotenv_secrets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/tests/test_deploy_dotenv_secrets.py b/backend/tests/test_deploy_dotenv_secrets.py index a0b4c6186a..9b4cb080de 100644 --- a/backend/tests/test_deploy_dotenv_secrets.py +++ b/backend/tests/test_deploy_dotenv_secrets.py @@ -314,7 +314,11 @@ real_compose = pytest.mark.parametrize( @pytest.fixture def real_docker(client: str, tmp_path: Path) -> str: """A `docker`-shaped entry point for the client: the CLI itself, or a shim that drops the `compose` word for a standalone binary.""" - if Path(client).name == "docker": + # The Docker CLI is docker.exe on Windows: compare the stem so the CLI is + # recognized there too. Feeding it through the standalone wrapper would + # strip the `compose` subcommand, and the root CLI then rejects the + # script's --env-file probe with "unknown flag: --env-file". + if Path(client).stem.lower() == "docker": return client shim = tmp_path / "compose-shim" / "docker" shim.parent.mkdir()