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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ jobs:
fi

# Tri-OS: trunk merges, lockfile changes, CI/tooling edits, or fs-sensitive code paths.
# Coverage floor is a no-regression ratchet at the current combined
# coverage. Target: 90%. Ratchet upward as tests for the spec-edge
# branches in _canonicalize / _constructor / _url are added.
if [[ "$ALWAYS_FULL" == "true" || "$CHANGED_OS" == "true" || "$CHANGED_LOCK" == "true" || "$CHANGED_CI" == "true" || "$CHANGED_TOOLING" == "true" ]]; then
echo 'os-matrix=["ubuntu-latest","windows-latest","macos-latest"]' >> "$GITHUB_OUTPUT"
echo "coverage-floor=85" >> "$GITHUB_OUTPUT"
echo "coverage-floor=82" >> "$GITHUB_OUTPUT"
else
echo 'os-matrix=["ubuntu-latest"]' >> "$GITHUB_OUTPUT"
echo "coverage-floor=80" >> "$GITHUB_OUTPUT"
echo "coverage-floor=82" >> "$GITHUB_OUTPUT"
fi
- name: Label PR from conventional commit type
if: github.event_name == 'pull_request'
Expand Down
19 changes: 19 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ lint-fix: _lint-py-fix _lint-sh-fix _lint-docs-fix
test:
uv run pytest

# Run the test suite under coverage. Produces a term-missing report and an
# HTML report at ``htmlcov/index.html`` for drilling into uncovered branches.
# Target: 90% combined coverage. CI's no-regression floor is in ``ci.yml``.
[group('quality')]
test-cov:
#!/usr/bin/env bash
set -euo pipefail
rm -f .coverage .coverage.*
uv run coverage run -m pytest
uv run coverage combine 2>/dev/null || true
uv run coverage report --skip-empty
uv run coverage html --skip-empty --skip-covered
printf '\nHTML report: htmlcov/index.html\n'

# Open the HTML coverage report in the default browser (macOS / Linux).
[group('quality')]
cov-open: test-cov
@command -v open >/dev/null && open htmlcov/index.html || xdg-open htmlcov/index.html

[group('quality')]
check: lint test

Expand Down
Loading