mirror of
https://github.com/NVIDIA/Model-Optimizer.git
synced 2026-10-02 03:14:52 +08:00
Include gpu and example tests also in codecov coverage reporting and enable omitted folder coverage (#1154)
So far, we only measured unit test coverage but we also have gpu test and example tests which needed to be setup differently to track in overall codecov coverage so we get accurate coverage reporting <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Strengthened code coverage measurement with parallelized collection across unit, GPU, and example test suites * Enhanced continuous integration workflow configuration with improved coverage reporting and threshold management * Updated testing infrastructure dependencies and settings to support more robust quality assurance processes <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
This commit is contained in:
@@ -61,6 +61,19 @@ jobs:
|
||||
|
||||
find examples/${{ inputs.example }} -name "requirements.txt" | while read req_file; do python -m pip install -r "$req_file" || exit 1; done
|
||||
- name: Run tests
|
||||
env:
|
||||
# Absolute paths so subprocesses running from different working directories
|
||||
# all find the config and write .coverage.* files to the same location.
|
||||
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
|
||||
COVERAGE_FILE: ${{ github.workspace }}/.coverage
|
||||
run: |
|
||||
echo "Running tests for: ${{ inputs.example }}"
|
||||
pytest tests/examples/${{ inputs.example }}
|
||||
pytest tests/examples/${{ inputs.example }} --cov
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage.xml
|
||||
flags: examples
|
||||
fail_ci_if_error: false # test may be skipped if relevant file changes are not detected
|
||||
verbose: true
|
||||
|
||||
@@ -86,7 +86,20 @@ jobs:
|
||||
run: |
|
||||
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/include:/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
|
||||
- name: Run gpu tests
|
||||
run: pip install tox-current-env && tox -e cuda13-${{ matrix.example }} --current-env
|
||||
env:
|
||||
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
|
||||
COVERAGE_FILE: ${{ github.workspace }}/.coverage
|
||||
run: |
|
||||
pip install tox-current-env
|
||||
COV_ARGS="--cov" tox -e cuda13-${{ matrix.example }} --current-env
|
||||
- name: Upload GPU coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage.xml
|
||||
flags: gpu
|
||||
fail_ci_if_error: false # test may be skipped if relevant file changes are not detected
|
||||
verbose: true
|
||||
gpu-tests-non-pr:
|
||||
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
|
||||
strategy: *gpu_strategy
|
||||
|
||||
@@ -43,6 +43,7 @@ jobs:
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
flags: unit
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
windows:
|
||||
|
||||
Reference in New Issue
Block a user