Skip to content

Commit

Permalink
ci: Fix failures in test coverage workflow (#16083)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed May 6, 2024
1 parent dd6e2ee commit d1f3ef4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
1 change: 0 additions & 1 deletion codecov.yml → .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ coverage:
patch: off
comment:
require_changes: true
after_n_builds: 3
ignore:
- crates/polars-arrow/src/io/flight/*.rs
- crates/polars-arrow/src/io/ipc/append/*.rs
Expand Down
59 changes: 37 additions & 22 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,10 @@ jobs:
run: cargo llvm-cov report --lcov --output-path coverage-rust.lcov

- name: Upload coverage report
uses: codecov/codecov-action@v4
uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-rust.lcov
root_dir: ${{ github.workspace }}
flags: rust
fail_ci_if_error: true
name: coverage-rust
path: coverage-rust.lcov

coverage-python:
# Running under ubuntu doesn't seem to work:
Expand All @@ -94,7 +91,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Create virtual environment
run: |
Expand Down Expand Up @@ -126,33 +123,51 @@ jobs:

- name: Run Python tests
working-directory: py-polars
run: pytest --cov -n auto --dist loadgroup -m "not release and not benchmark and not docs" --cov-report xml:main.xml
continue-on-error: true
run: >
pytest
-n auto --dist loadgroup
-m "not release and not benchmark and not docs"
-k 'not test_polars_import'
--cov --cov-report xml:main.xml
- name: Run Python tests - async reader
working-directory: py-polars
env:
POLARS_FORCE_ASYNC: 1
run: pytest --cov -n auto --dist loadgroup -m "not release and not benchmark and not docs" tests/unit/io/ --cov-report xml:async.xml
continue-on-error: true
run: >
pytest tests/unit/io/
-n auto --dist loadgroup
-m "not release and not benchmark and not docs"
--cov --cov-report xml:async.xml --cov-fail-under=0
- name: Report Rust coverage
run: cargo llvm-cov report --lcov --output-path coverage-python.lcov

- name: Upload coverage reports - Python
uses: codecov/codecov-action@v4
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: py-polars/main.xml,py-polars/async.xml
root_dir: ${{ github.workspace }}
flags: python
fail_ci_if_error: true
name: coverage-python
path: |
coverage-python.lcov
py-polars/main.xml
py-polars/async.xml
upload-coverage:
needs: [coverage-rust, coverage-python]
runs-on: ubuntu-latest

steps:
# Needed to fetch the Codecov config file
- uses: actions/checkout@v4

- name: Download coverage reports
uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Upload coverage report - Rust
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-python.lcov
files: coverage-rust.lcov,coverage-python.lcov,py-polars/main.xml,py-polars/async.xml
root_dir: ${{ github.workspace }}
flags: rust
fail_ci_if_error: true
9 changes: 2 additions & 7 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,9 @@ jobs:
python tests/docs/run_doctest.py
pytest tests/docs/test_user_guide.py -m docs
- name: Run tests and report coverage
- name: Run tests
if: github.ref_name != 'main'
env:
# TODO: Re-enable coverage for for Ubuntu + Python 3.12 tests
# Currently skipped due to performance issues in coverage:
# https://github.com/nedbat/coveragepy/issues/1665
COV: ${{ !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12') && '--cov' || '--no-cov' }}
run: pytest $COV -n auto --dist loadgroup -m "not release and not benchmark and not docs"
run: pytest -n auto --dist loadgroup -m "not release and not benchmark and not docs"

- name: Run tests async reader tests
if: github.ref_name != 'main' && matrix.os != 'windows-latest'
Expand Down

0 comments on commit d1f3ef4

Please sign in to comment.