From 351d73079a3b9e3fee74dd0a5d861e49bc0461fb Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Wed, 14 Oct 2026 08:08:32 +0200 Subject: [PATCH] ci: the host job keeps the hunt and semantic extras; a benchmark main no longer leaks GIT_NO_LAZY_FETCH into later tests The workflow runs pytest twice: in the dagger container (now one failure) and on the runner host, whose job synced the dev group only, so dspy and tree-sitter were missing there (25 failures). The one failure shared by both runs was the partial-clone extraction test: engine_trace.main sets GIT_NO_LAZY_FETCH in the process environment, the variable outlived its tests, and git 2.44 and newer refuse the lazy fetch with "lazy fetching disabled". The local git ignores the variable, so the leak was invisible here; the test module now restores the variable after each test (leak checked with a session-end probe: present before, absent after). Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci.yml | 5 ++++- tests/test_engine_trace.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5a74ee..ef1ae00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,9 @@ permissions: jobs: checks: runs-on: ubuntu-latest + env: + # uv run re-syncs to the lockfile's default extras unless told not to; it removed the extras below before pytest. + UV_NO_SYNC: "1" steps: - uses: actions/checkout@v5 - uses: astral-sh/setup-uv@v7 @@ -19,7 +22,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version-file: .python-version - - run: uv sync --group dev + - run: uv sync --group dev --extra hunt --extra semantic - run: uv run ruff format --check . - run: uv run ruff check . - run: uv run mypy src/openultrasast diff --git a/tests/test_engine_trace.py b/tests/test_engine_trace.py index 722e9c2..e95d1a9 100644 --- a/tests/test_engine_trace.py +++ b/tests/test_engine_trace.py @@ -4,6 +4,7 @@ from __future__ import annotations import importlib.util import json +import os import subprocess import sys from collections import Counter @@ -28,6 +29,21 @@ with pytest.MonkeyPatch.context() as patch: worker = sys.modules["engine_trace_worker"] +@pytest.fixture(autouse=True) +def _main_env_does_not_outlive_the_test(): + """engine_trace.main pins GIT_NO_LAZY_FETCH for its own run; the variable must not leak into later tests. + + Git 2.44 and newer honour it, and the partial-clone extraction test then fails on a refusal that has nothing + to do with extraction (seen in CI; the local git ignores the variable, so the leak was invisible here). + monkeypatch.delenv records nothing for an absent variable, so the restore is explicit.""" + before = os.environ.get("GIT_NO_LAZY_FETCH") + yield + if before is None: + os.environ.pop("GIT_NO_LAZY_FETCH", None) + else: + os.environ["GIT_NO_LAZY_FETCH"] = before + + def row(**extra): return { "sink": "os.system(cmd)",