[CI] Add ut coverage tool (#20628)

This commit is contained in:
Ke Bao
2026-03-15 21:13:45 +08:00
committed by GitHub
parent 45dd06f4e0
commit e2be31824f
3 changed files with 27 additions and 0 deletions
+9
View File
@@ -22,6 +22,15 @@ Tests can use CPU or GPU — the key criterion is **no server process**.
pytest test/registered/unit/ -v # all unit tests
pytest test/registered/unit/mem_cache/ -v # one module
```
5. Run with coverage:
```bash
# summary
pytest test/registered/unit/ --cov --cov-config=.coveragerc -v
# PR incremental check (require ≥60% on changed lines)
pytest test/registered/unit/ --cov --cov-config=.coveragerc --cov-report=xml
diff-cover coverage.xml --compare-branch=origin/main --fail-under=60
```
## Example