Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions tests/test_claude_issue_triage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
TRIAGE_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "claude-issue-triage.yml"


def _git_bash_candidates(git_executable: Path) -> tuple[Path, ...]:
git_directory = git_executable.parent
return (
git_directory / "bash.exe",
git_directory.parent / "bin" / "bash.exe",
git_directory.parent.parent / "bin" / "bash.exe",
)


def _bash_executable() -> str:
if os.name != "nt":
return "bash"
Expand All @@ -21,14 +30,10 @@ def _bash_executable() -> str:
if git_executable is None:
raise RuntimeError("Git for Windows is required to run the triage helper tests")

git_directory = Path(git_executable).parent
git_bin_directory = (
git_directory if git_directory.name.casefold() == "bin" else git_directory.parent / "bin"
)
git_bash = git_bin_directory / "bash.exe"
if not git_bash.is_file():
raise RuntimeError(f"Git Bash was not found at {git_bash}")
return str(git_bash)
for git_bash in _git_bash_candidates(Path(git_executable)):
if git_bash.is_file():
return str(git_bash)
raise RuntimeError(f"Git Bash was not found near {git_executable}")


def _run_triage_helper(
Expand Down Expand Up @@ -115,6 +120,12 @@ def _run_triage_helper(
return result, gh_calls


def test_git_bash_candidates_include_launcher_for_mingw_git() -> None:
git_executable = Path("Git") / "mingw64" / "bin" / "git.exe"

assert Path("Git") / "bin" / "bash.exe" in _git_bash_candidates(git_executable)


def test_triage_helper_updates_only_owned_labels_without_replacing_other_labels(
tmp_path: Path,
) -> None:
Expand Down
Loading