Skip to content

ci: run unit, integration, doctest, and example checks - #65

Merged
j-bryan merged 2 commits into
mainfrom
ci/run-tests-and-examples
Oct 28, 2026
Merged

j-bryan merged 2 commits into
mainfrom
ci/run-tests-and-examples

Conversation

@dylanjm

@dylanjm dylanjm commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #64

Summary

  • Replaces the pre-commit job in .github/workflows/ci.yml with a single tests job that runs on Python 3.11, 3.12, and 3.13. Each kind of check is its own step, so a failure shows which one broke:
    • Unit tests: pytest tests/unit -n auto
    • Integration tests: pytest tests/test_documented_outputs.py (runs the examples and the getting-started snippet and compares their output with the documented values)
    • Docstring tests: pytest dcaf (uses the --doctest-modules addopt already in the config)
    • Examples: runs every examples/*.py script, so examples not covered by the documented-output test (e.g. ppa_revenue_policies.py) are still checked
  • Lint, format, type, and copyright checks (ruff, mypy, check_copyright.py, whitespace hooks) are no longer run in CI. They still run locally through pre-commit.
  • Fixes examples/ppa_revenue_policies.py. It crashed with TypeError because GenerationSettlementEvent now requires period_start/period_end. It now passes the one-day [date, date + 1 day) bounds that a legacy-dated Generation resolves to.

Test plan

  • Ran every step locally on Python 3.11 and 3.13: 955 unit, 6 integration, and 84 doctests passed, and all 6 examples ran (1045 tests in total, the same as a full pytest collection)
  • CI passes on all three matrix versions

🤖 Generated with Claude Code

dylanjm and others added 2 commits October 28, 2026 09:43
…-3.13

Adds a `tests` job to the CI workflow with separate steps for unit tests,
documented-output integration tests, docstring tests, and every script in
examples/. Also fixes examples/ppa_revenue_policies.py, which crashed because
GenerationSettlementEvent now requires period_start and period_end.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>

@j-bryan j-bryan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good CI changes

@j-bryan
j-bryan merged commit 711030b into main Oct 28, 2026
3 checks passed
@j-bryan
j-bryan deleted the ci/run-tests-and-examples branch October 28, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Current CI doesn't perform testing.

2 participants