Problem
The reactome_chatbot repository currently has no automated test suite and no CI testing infrastructure. This creates several risks as the project scales:
- Contributors cannot easily verify their changes don't break existing behaviour
- Regressions in critical paths (config loading, retrieval logic) go undetected until runtime
- The absence of a test gate makes it harder to confidently merge PRs
Proposed Solution
Introduce a lightweight testing foundation using pytest, targeting the core modules most critical to chatbot operation:
util.config_yml — Validate that config.yml (and default fallbacks) parse correctly into Pydantic models, and that feature flags / usage limits evaluate as expected
retrievers.csv_chroma — Unit test utility helpers such as ChromaDB subdirectory discovery, ensuring retrieval scaffolding behaves correctly under edge cases
Implementation Plan
- Add a
tests/ directory at the project root
- Add
pytest and pytest-mock to pyproject.toml under [tool.poetry.group.dev.dependencies]
- Add a GitHub Actions workflow at
.github/workflows/tests.yml that triggers on push and pull requests
- Write initial test coverage for the two modules above as a foundation others can build on
Example Test Structure
tests/
├── __init__.py
├── test_config_yml.py # Config loading, defaults, validation
└── test_csv_chroma.py # ChromaDB subdir discovery, edge cases
Impact
| Area |
Benefit |
| Maintainability |
Contributors can verify changes without manual testing |
| Stability |
Prevents silent regressions in retrieval and config pipelines |
| CI Gate |
PRs blocked from merging if tests fail |
| Onboarding |
New contributors have a clear, testable contract for each module |
Related
This complements ongoing work in:
Opening a PR with the initial tests/ scaffolding and GitHub Actions workflow.
Problem
The
reactome_chatbotrepository currently has no automated test suite and no CI testing infrastructure. This creates several risks as the project scales:Proposed Solution
Introduce a lightweight testing foundation using
pytest, targeting the core modules most critical to chatbot operation:util.config_yml— Validate thatconfig.yml(and default fallbacks) parse correctly into Pydantic models, and that feature flags / usage limits evaluate as expectedretrievers.csv_chroma— Unit test utility helpers such as ChromaDB subdirectory discovery, ensuring retrieval scaffolding behaves correctly under edge casesImplementation Plan
tests/directory at the project rootpytestandpytest-mocktopyproject.tomlunder[tool.poetry.group.dev.dependencies].github/workflows/tests.ymlthat triggers on push and pull requestsExample Test Structure
Impact
Related
This complements ongoing work in:
Opening a PR with the initial
tests/scaffolding and GitHub Actions workflow.