Skip to content
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
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration for Codecov: https://docs.codecov.com/docs/codecov-yaml
#
# Coverage reports are generated by `nox -s coverage-<python>` and
# Coverage reports are generated by `nox -s dagster_with_coverage` and
# uploaded in .github/workflows/ci.yml.

coverage:
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,10 @@ jobs:
python: '3.13'
nox_session: tests-3.13

- name: Tests with code coverage, Python 3.12
os: ubuntu-latest
python: '3.12'
nox_session: coverage-3.12

- name: Tests with Dagster
- name: Tests with code coverage and Dagster, Python 3.14
os: ubuntu-latest
python: '3.14'
nox_session: dagster
nox_session: dagster_with_coverage

- name: Tests, Python 3.11
os: macos-latest
Expand Down Expand Up @@ -124,7 +119,7 @@ jobs:
run: uv run noxfile.py --session '${{ matrix.nox_session }}'

- name: Upload coverage reports to Codecov
if: ${{ contains(matrix.nox_session, 'cov') }}
if: ${{ matrix.nox_session == 'dagster_with_coverage' }}
uses: codecov/codecov-action@v7.0.0
with:
files: ./coverage.xml
Expand Down
19 changes: 7 additions & 12 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,21 @@ def tests(session: nox.Session) -> None:


@nox_uv.session(uv_groups=["test", "dagster"], python=MAXPYTHON)
def dagster(session: nox.Session) -> None:
def dagster_with_coverage(session: nox.Session) -> None:
"""
Run the tests of logging with Dagster.
Run all tests, including Dagster tests, with code coverage.

Dagster has many dependencies, so it is installed only for this
session. The ``tests`` session skips these tests.
"""
session.install(".")
session.run("pytest", "tests/test_logging.py", "-k", "dagster", *session.posargs)


@nox_uv.session(uv_groups=["test"], python=SUPPORTED_PYTHON_VERSIONS)
def coverage(session: nox.Session) -> None:
"""
Run tests with pytest and measure code coverage.
session. The ``tests`` session skips the Dagster tests.

The project is installed in editable mode (by ``uv sync``) so that
file paths in the coverage report point to ``src/``, which is
needed for the report uploaded to Codecov to map onto the source.

In CI, reports are uploaded by ``codecov/codecov-action``. To upload
a report locally, set the ``CODECOV_TOKEN`` environment variable and
run ``uvx --from codecov-cli codecovcli upload-process``.

Configuration: ``[tool.coverage]`` in pyproject.toml
"""
session.run(
Expand Down
Loading