Skip to content

[ci] Code coverage integration test #7169

@daguirre11

Description

@daguirre11

Summary

As part of the contributions made in #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.yaml CI workflow
  • Add a job to code_cov.yaml that 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: 1

References

#7031

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions