From 2643e519f05782587b36a0d43d869acec5c2f66c Mon Sep 17 00:00:00 2001 From: 3ae3ae Date: Mon, 19 Oct 2026 22:16:02 +0900 Subject: [PATCH] test: skip the shell syntax check when that shell is not installed GitHub's Ubuntu runners have no zsh, so the completion test failed there on /bin/zsh. It now finds bash and zsh on PATH and only checks the generated script's text for a shell that is missing. Co-Authored-By: Claude Opus 5.5 --- tests/test_cli.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 7019bbc0..78c9b2fc 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -20,6 +20,7 @@ import io import json import os +import shutil import subprocess import sys import tempfile @@ -501,9 +502,10 @@ def test_completion_aliases_and_module_entry(self): for command in main.COMMANDS: self.assertIn(":" + command, script) self.assertIn("--only-tasks", script) - result = subprocess.run( - ["/bin/" + shell, "-n"], input=script, text=True, capture_output=True - ) + binary = shutil.which(shell) + if binary is None: # e.g. no zsh on a Linux CI runner: only the text is checked + continue + result = subprocess.run([binary, "-n"], input=script, text=True, capture_output=True) self.assertEqual(result.returncode, 0, result.stderr) if shell == "bash": probe = ( @@ -516,7 +518,7 @@ def test_completion_aliases_and_module_entry(self): + script + "\nwords=(harness2 run --on); CURRENT=3; _harness2_complete" ) - result = subprocess.run(["/bin/" + shell], input=probe, text=True, capture_output=True) + result = subprocess.run([binary], input=probe, text=True, capture_output=True) self.assertEqual(result.returncode, 0, result.stderr) self.assertIn("--only-tasks", result.stdout) for executable, command in main.ALIASES.items():