Add automated test suite, GitHub Actions CI, and CONTRIBUTING.md#24
Merged
Merged
Conversation
- Add tests/ directory with 133 pytest tests covering: - batch_creation: JSONL generation, forbid_additional_props, prompt construction - batch_parsing: _safe_parse_model_text, get_client, get_batch_results with mocked API - data_conversion: make_str_enum, to_long_df, join_datasets - data_import: CSV/TSV/Excel reading without GUI - settings: user config load/save/precedence - reliability: compute_cohens_kappa pure logic - Add tests/fixtures/ with sample CSV data and a realistic fixture - Add requirements-dev.txt (pytest, pytest-mock) - Add pytest.ini configuration - Add .github/workflows/tests.yml (CI on push + PR, Python 3.10/3.11/3.12) - Add CONTRIBUTING.md with setup, testing, structure, and contribution guide - Update README.md with developer/testing section Agent-Logs-Url: https://github.com/tmaier-kettering/CodebookAI/sessions/e942e5e4-04d0-4469-bc8e-c6be9e3afdaa Co-authored-by: tmaier-kettering <109093855+tmaier-kettering@users.noreply.github.com>
Agent-Logs-Url: https://github.com/tmaier-kettering/CodebookAI/sessions/e942e5e4-04d0-4469-bc8e-c6be9e3afdaa Co-authored-by: tmaier-kettering <109093855+tmaier-kettering@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tmaier-kettering
April 30, 2026 19:24
View session
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.
CodebookAI lacked automated tests, CI, and contributor guidance — making it hard to verify core behavior or accept contributions with confidence.
Tests (133 passing, no live API calls)
test_batch_creation.pyforbid_additional_props, single/multi-label and keyword JSONL generation, prompt content, schema structure, empty input, non-ASCII, punctuation, long/short excerptstest_batch_parsing.py_safe_parse_model_text(valid JSON, fenced, truncated, non-JSON recovery, empty);get_clientauth failure;get_batch_resultswith fully mocked OpenAI client (success, mixed good/bad rows, repair notes, auth error, rate limit, connection error, unexpected schema)test_data_conversion.pymake_str_enum(unicode, Pydantic enforcement),to_long_df(multi-label explode, nested dicts),join_datasetstest_data_import.pytest_settings.pyget_settingprecedencetest_reliability.pyNo refactoring of application code was required — all tested logic was already in pure, GUI-free functions.
CI (
.github/workflows/tests.yml)Runs on every push and PR across Python 3.10, 3.11, and 3.12. Installs
python3-tk+xvfb-runfor headless compatibility. SetsMPLBACKEND=Aggand a null keyring backend to prevent environment-sensitive failures.Supporting infrastructure
requirements-dev.txt—pytest,pytest-mockpytest.ini— testpaths, short tracebackstests/fixtures/—sample_labels.csv,sample_quotes.csv,realistic_dataset.csv(financial-domain excerpts including non-ASCII)CONTRIBUTING.md— local setup, running tests, project structure, coding conventions, bug reporting, PR processREADME.md— new Developer Guide sectionKnown gaps (still require manual testing)