Skip to content

bug: Missing automated test suite causes undetected regressions across critical modules #134

@bhavyakeerthi3

Description

@bhavyakeerthi3

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:

  1. util.config_yml — Validate that config.yml (and default fallbacks) parse correctly into Pydantic models, and that feature flags / usage limits evaluate as expected
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions