Phase 3: Add pytest test suite and GitHub Actions CI - #8
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds automated testing and continuous integration so the project validates every push and pull request. Closes #3.
requirements-dev.txt(runtime deps +pytest+ruff); no migration to Poetry/Hatch.E,F,I,UP,B) and pytest inpyproject.toml, withsrcon the pytestpythonpathso tests run without an editable install.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 whentimestamp/valueare 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 ontmp_pathCSVs plus a missing-file error path..github/workflows/ci.yml(Python 3.11, single Linux job) runningruff check .andpytest.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:
CI on this PR runs the same two commands. The CI badge will resolve once the workflow runs on
main.Follow-up Work
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