Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix failures in test coverage workflow #16083

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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