mirror of
https://github.com/TencentCloud/Octop.git
synced 2026-09-28 19:33:02 +08:00
testmon decides which files changed via `git ls-files --stage -m` (worktree vs index). At pre-commit time the changes are already staged, so that comparison is empty and testmon silently deselects every test — a false green that makes the fast gate worthless. Patch testmon's file detection to use `git diff HEAD` (staged + unstaged) via conftest.py and tests/support/testmon_staged_changes.py, so the gate actually fires on a commit's changes. No-op when testmon is absent. Co-Authored-By: Claude <noreply@anthropic.com>
12 lines
438 B
Python
12 lines
438 B
Python
"""Repo-root conftest.
|
|
|
|
Imported by pytest at startup (before any plugin's ``pytest_configure``), so the
|
|
testmon change-detection patch in ``tests.support.testmon_staged_changes`` is
|
|
applied before testmon reads file fingerprints. The patch only affects
|
|
testmon's internals and is a safe no-op when testmon is absent.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import tests.support.testmon_staged_changes # noqa: F401 (applies the patch)
|