test: the claims hook runner skips through need_tools rather than its own which-loop
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 2m19s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m21s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 2m19s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m21s
_run_hook in test_task_claims.py repeated the shutil.which -> pytest.skip guard that tests.helpers.need_tools exists to hold once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ import pytest_asyncio
|
|||||||
|
|
||||||
from grimoire.services import notes as notes_svc
|
from grimoire.services import notes as notes_svc
|
||||||
from grimoire.services import task_claims as tc
|
from grimoire.services import task_claims as tc
|
||||||
from tests.helpers import ensure_user, http_sink
|
from tests.helpers import ensure_user, http_sink, need_tools
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[1]
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
@@ -235,12 +235,9 @@ def test_a_dead_claim_on_finished_work_is_not_news():
|
|||||||
|
|
||||||
def _run_hook(script, event, tmp_path, port):
|
def _run_hook(script, event, tmp_path, port):
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
for tool in ("bash", "curl"):
|
need_tools("bash", "curl")
|
||||||
if shutil.which(tool) is None:
|
|
||||||
pytest.skip(f"hook runtime tool {tool!r} not installed")
|
|
||||||
env = {"PATH": os.environ["PATH"], "HOME": str(tmp_path), "TMPDIR": str(tmp_path),
|
env = {"PATH": os.environ["PATH"], "HOME": str(tmp_path), "TMPDIR": str(tmp_path),
|
||||||
"GRIMOIRE_URL": f"http://127.0.0.1:{port}", "GRIMOIRE_TOKEN": "t",
|
"GRIMOIRE_URL": f"http://127.0.0.1:{port}", "GRIMOIRE_TOKEN": "t",
|
||||||
"CLAUDE_PROJECT_DIR": str(tmp_path)}
|
"CLAUDE_PROJECT_DIR": str(tmp_path)}
|
||||||
|
|||||||
Reference in New Issue
Block a user