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
44 changes: 40 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ jobs:
- name: Install
run: uv sync --all-extras --dev
- name: pytest core (tests/ + packages/databox)
run: uv run pytest tests packages/databox --override-ini="testpaths=tests packages/databox"
# Shard runs drop --cov-fail-under; the monolithic `tests-all` job
# enforces the 70% floor against the whole workspace (where each
# source package is actually exercised).
run: uv run pytest tests packages/databox -o "testpaths=tests packages/databox" -o "addopts=-v --tb=short --cov --cov-report=term-missing"

tests-ebird:
name: pytest (ebird)
Expand All @@ -158,7 +161,7 @@ jobs:
- name: Install
run: uv sync --all-extras --dev
- name: pytest ebird
run: uv run pytest packages/databox-sources/tests/ebird --override-ini="testpaths=packages/databox-sources/tests/ebird"
run: uv run pytest packages/databox-sources/tests/ebird -o "testpaths=packages/databox-sources/tests/ebird" -o "addopts=-v --tb=short --cov --cov-report=term-missing"

tests-noaa:
name: pytest (noaa)
Expand All @@ -174,7 +177,7 @@ jobs:
- name: Install
run: uv sync --all-extras --dev
- name: pytest noaa
run: uv run pytest packages/databox-sources/tests/noaa --override-ini="testpaths=packages/databox-sources/tests/noaa"
run: uv run pytest packages/databox-sources/tests/noaa -o "testpaths=packages/databox-sources/tests/noaa" -o "addopts=-v --tb=short --cov --cov-report=term-missing"

tests-usgs:
name: pytest (usgs)
Expand All @@ -190,7 +193,40 @@ jobs:
- name: Install
run: uv sync --all-extras --dev
- name: pytest usgs
run: uv run pytest packages/databox-sources/tests/usgs --override-ini="testpaths=packages/databox-sources/tests/usgs"
run: uv run pytest packages/databox-sources/tests/usgs -o "testpaths=packages/databox-sources/tests/usgs" -o "addopts=-v --tb=short --cov --cov-report=term-missing"

tests-all:
# Coverage-floor gate. Runs each shard sequentially under `coverage run
# --append` so per-source VCR cassettes do not collide (pytest-recording
# matches requests globally in-process, so running ebird+noaa+usgs in
# one pytest session produces cross-source cassette mismatches). The
# accumulated .coverage file is then reported with `--fail-under=70`.
# This is the one place the 70% floor is enforced; shard jobs above
# skip enforcement but still give fast per-source failure signal.
name: pytest (all, coverage floor)
needs: changes
if: needs.changes.outputs.needs_full == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install
run: uv sync --all-extras --dev
- name: Erase previous coverage
run: uv run coverage erase
- name: Coverage — core (tests/ + packages/databox)
run: uv run coverage run --append -m pytest tests packages/databox -o "testpaths=tests packages/databox" -o "addopts=-v --tb=short"
- name: Coverage — ebird
run: uv run coverage run --append -m pytest packages/databox-sources/tests/ebird -o "testpaths=packages/databox-sources/tests/ebird" -o "addopts=-v --tb=short"
- name: Coverage — noaa
run: uv run coverage run --append -m pytest packages/databox-sources/tests/noaa -o "testpaths=packages/databox-sources/tests/noaa" -o "addopts=-v --tb=short"
- name: Coverage — usgs
run: uv run coverage run --append -m pytest packages/databox-sources/tests/usgs -o "testpaths=packages/databox-sources/tests/usgs" -o "addopts=-v --tb=short"
- name: Coverage report (fail under 70%)
run: uv run coverage report --fail-under=70 --show-missing

sqlmesh-lint:
name: SQLMesh lint
Expand Down
2 changes: 2 additions & 0 deletions docs/dictionary/analytics/platform_health.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Per-source load observability — most recent dlt load id, completion time, stat
- `main._dlt_loads` (external)
- `main.daily_values` (external)
- `main.sites` (external)
- `main._dlt_loads` (external)
- `main.events` (external)

## Example query

Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ omit = [
]

[tool.coverage.report]
fail_under = 70
# The 70% floor is enforced by the `tests-all` CI job via
# `--cov-fail-under=70` (inherited from `[tool.pytest.ini_options]
# addopts`). It is intentionally NOT set here because coverage.py's
# `fail_under` is read during `coverage.report()` whether or not
# pytest-cov's CLI flag is passed — which means shard jobs would keep
# failing even after overriding `addopts` to drop `--cov-fail-under`.
skip_covered = false
show_missing = true
exclude_lines = [
Expand Down
Loading