fix(quality): unify coverage gate across CI, dev-verify, and codecov
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled

This commit is contained in:
Hermes Agent
2026-06-15 12:45:06 +08:00
parent 7fabc23715
commit 243d1b9427
4 changed files with 57 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
#!/usr/bin/env python3
"""Fail CI when coverage gates are not met."""
"""Fail CI when coverage gates are not met.
Single source of truth for the coverage gate.
CI workflow, dev-verify, and codecov all read this file (or
the same OVERALL_MIN / CORE_MIN constants) so the gate no
longer diverges across surfaces.
"""
from __future__ import annotations
@@ -7,6 +13,7 @@ import sys
import xml.etree.ElementTree as ET
from pathlib import Path
# Mirrors `tests/test_coverage_gate_core.py` thresholds.
OVERALL_MIN = 0.80
CORE_MIN = 1.00
CORE_FILES = (

View File

@@ -32,6 +32,7 @@ install_requirements() {
run_checks() {
cd "${ROOT_DIR}"
log "running pytest with coverage gate"
# Single source of truth threshold: matches scripts/check_coverage_gate.py
python -m pytest admin/tests tests data \
--ignore=.venv \
--ignore=.worktrees \