From ea29efc52dae93a0c8c327eb138dae575ab7e9ec Mon Sep 17 00:00:00 2001 From: h1s97x <3229724715002795-h1s97x@noreply.coze.cn> Date: Sat, 16 May 2026 23:03:28 +0800 Subject: [PATCH] feat: add pytest-cov coverage gate to CI - Add pytest-cov to test dependencies - Run tests with coverage report: --cov=core --cov=infrastructure - Set minimum coverage threshold: 5% (--cov-fail-under=5) - Generate coverage report with missing lines Note: Coverage threshold starts at 5% and will increase as more tests are added. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea587cf..db8ddcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,12 +44,12 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install gmssl - pip install pytest gmssl + pip install pytest pytest-cov gmssl - - name: Run unit tests + - name: Run unit tests with coverage run: | export PYTHONPATH="${GITHUB_WORKSPACE}:${PYTHONPATH}" - pytest tests/unit/ -v + pytest tests/unit/ -v --cov=core --cov=infrastructure --cov-report=term-missing --cov-fail-under=5 build-check: name: Build Check