From 7ccdfb8460db5982abbb2d6317d073d17361de14 Mon Sep 17 00:00:00 2001 From: Evgeny Bushkov Date: Fri, 23 Oct 2026 19:06:19 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20.sh-=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82?= =?UTF-8?q?=D1=8B=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20sh=20=D0=BD=D0=B0=20W?= =?UTF-8?q?indows=20=D0=B2=20test-deps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aider (deepseek/deepseek-chat) --- tests/test_dependency_failure.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_dependency_failure.py b/tests/test_dependency_failure.py index 1641b2fb..35ba2eb0 100644 --- a/tests/test_dependency_failure.py +++ b/tests/test_dependency_failure.py @@ -8,6 +8,7 @@ import argparse import base64 import json import os +import shutil import subprocess import sys import time @@ -30,11 +31,24 @@ BASE_URL = (_args.base_url or os.environ.get("BASE_URL") or "http://localhost:80 ROOT = Path(__file__).resolve().parents[1] +def _script_command(full: Path) -> list[str]: + """Windows не умеет запускать .sh напрямую — вызываем через sh (Git Bash/WSL).""" + if os.name == "nt": + sh = shutil.which("sh") or shutil.which("bash") + if not sh: + raise unittest.SkipTest( + "sh/bash not found in PATH; install Git for Windows or run under WSL" + ) + return [sh, str(full)] + return [str(full)] + + def run_script(path): full = (ROOT / path).resolve() if not full.is_file(): raise unittest.SkipTest("script not found: " + str(full)) - proc = subprocess.run([str(full)], cwd=str(ROOT), capture_output=True, timeout=120) + cmd = _script_command(full) + proc = subprocess.run(cmd, cwd=str(ROOT), capture_output=True, timeout=120) if proc.returncode != 0: raise AssertionError( "script failed: " + path + " rc=" + str(proc.returncode)