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)",