Skip to content

Commit 7eead4d

Browse files
committed
ci: trace core imports before pytest-cov
Signed-off-by: Rui Luo <[email protected]>
1 parent 4010017 commit 7eead4d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎.github/workflows/coverage.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ jobs:
181181
cd $INSTALL_ROOT
182182
$REPO_ROOT/.venv/bin/pytest -v --cov=./cuda --cov-append --cov-context=test --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_bindings_13/tests
183183
184+
- name: Trace cuda.core imports
185+
continue-on-error: true
186+
run: |
187+
cd $INSTALL_ROOT
188+
# Trace collection-time imports before the regular pytest-cov run.
189+
"$REPO_ROOT/.venv/bin/python" -m coverage run \
190+
--append --source=./cuda --rcfile="$REPO_ROOT/.coveragerc" \
191+
-m pytest -p no:pytest_cov --collect-only -qq "$REPO_ROOT/cuda_core/tests"
192+
184193
- name: Run cuda.core tests
185194
continue-on-error: true
186195
run: |
@@ -440,6 +449,15 @@ jobs:
440449
--cov-config="$GITHUB_WORKSPACE/.coveragerc" \
441450
"$GITHUB_WORKSPACE/cuda_bindings_13/tests"
442451
452+
- name: Trace cuda.core imports
453+
continue-on-error: true
454+
run: |
455+
cd "${{ steps.install-root.outputs.INSTALL_ROOT }}"
456+
# Use a separate process so pytest-cov retains lifecycle contexts.
457+
"$GITHUB_WORKSPACE/.venv/Scripts/python" -m coverage run \
458+
--append --source=./cuda --rcfile="$GITHUB_WORKSPACE/.coveragerc" \
459+
-m pytest -p no:pytest_cov --collect-only -qq "$GITHUB_WORKSPACE/cuda_core/tests"
460+
443461
- name: Run cuda.core tests
444462
continue-on-error: true
445463
run: |

0 commit comments

Comments
 (0)