Skip to content

Phase 3: Add pytest test suite and GitHub Actions CI - #8

Merged
WolfpackOfOne merged 1 commit into
mainfrom
ci/add-tests
Jun 14, 2026
Merged

Phase 3: Add pytest test suite and GitHub Actions CI#8
WolfpackOfOne merged 1 commit into
mainfrom
ci/add-tests

Conversation

@WolfpackOfOne

Copy link
Copy Markdown
Owner

Summary

Adds automated testing and continuous integration so the project validates every push and pull request. Closes #3.

  • Adds requirements-dev.txt (runtime deps + pytest + ruff); no migration to Poetry/Hatch.
  • Configures Ruff (E, F, I, UP, B) and pytest in pyproject.toml, with src on the pytest pythonpath so tests run without an editable install.
  • Adds a tests/ suite using only tiny synthetic data (no competition data):
    • test_features.py — engineered columns, row-count preservation, no-NaN-after-fill, timestamp sorting, and clear errors when timestamp/value are missing.
    • test_models.py — pipeline construction, reproducible seed, fit/predict, prediction length.
    • test_prediction_output.py — submission schema (timestamp, has_structural_break), row count, binary predictions.
    • test_cli.py — subprocess end-to-end run on tmp_path CSVs plus a missing-file error path.
  • Adds .github/workflows/ci.yml (Python 3.11, single Linux job) running ruff check . and pytest.
  • Adds CI + license badges and a Development section to the README.

Motivation

Structural-break pipelines break silently — feature leakage across time, output-schema drift, path handling. A small, fast test suite plus CI proves the baseline works, makes future refactors (Phase 4 detectors) safer, and signals to reviewers that this is a maintained project.

Validation

In a fresh virtual environment:

pip install -r requirements-dev.txt && pip install -e .
ruff check .   # All checks passed!
pytest         # 17 passed

CI on this PR runs the same two commands. The CI badge will resolve once the workflow runs on main.

Follow-up Work

  • Phase 4 (research/add-change-point-models): CUSUM, rolling z-score, and PELT detectors on a shared interface, each with synthetic-data tests.

https://claude.ai/code/session_01Ddjy7PGk1UdXXcn95NyrGt


Generated by Claude Code

- Add requirements-dev.txt (runtime deps + pytest + ruff)
- Configure ruff and pytest in pyproject.toml (src on pythonpath)
- Add tests/ using only tiny synthetic data:
  - test_features.py: engineered columns, row count, fill, sorting, errors
  - test_models.py: pipeline construction, fit/predict, length
  - test_prediction_output.py: submission schema and shape
  - test_cli.py: subprocess end-to-end run + missing-file error
- Add .github/workflows/ci.yml running ruff and pytest on push/PR
- Add CI and license badges and a Development section to the README
@WolfpackOfOne
WolfpackOfOne merged commit deb8211 into main Jun 14, 2026
1 check passed
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.

Phase 3: Add pytest test suite and GitHub Actions CI

2 participants