[ci] Code coverage integration test
Author: daguirre11Created Feb 24, 2026Updated Sep 25, 2026
Labelsquestionmaintenance
Summary
As part of the contributions made in https://github.com/microsoft/LightGBM/issues/7031, I would like to add a CI step that runs code coverage on the Python package tests with a minimum threshold for passing. I would defer to the repo owners on the exact threshold, but suggest at least 90%, preferably 95%.
Motivation
This will ensure that each feature is adequately tested, new features include test coverage, and existing features continue to work as expected.
Description
Something along the lines of:
- Add
code_cov.yamlCI workflow - Add a job to
code_cov.yamlthat installs dependencies and runs the Python package tests - Add a step to
code_cov.yaml:
run: |
coverage erase
pytest --cov=lightgbm --cov-branch --cov-report=term-missing --cov-report=html --cov-report=xml --junitxml=junit/test-results.xml -vv tests/python_package_test/
coverage report --fail-under=90
env:
PY_COLORS: 1References
Source: lightgbm-org/LightGBM