-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Description
The project currently has zero unit tests or integration tests for any backend module. There is no tests/ directory in backend/ or at the project root, and no test_*.py files exist for any of the core modules (main.py, agents.py, retrieval.py, knowledgespace_api.py, ks_search_tool.py).
Without tests, there is no automated way to verify that new PRs do not break existing functionality. This makes code review harder, increases the risk of regressions, and blocks CI/CD automation.
Verification
I searched the entire project directory and confirmed there are no project-specific test files:
- ❌ No
tests/directory in project root - ❌ No
tests/directory inbackend/ - ❌ No
test_*.pyfiles anywhere inbackend/ - ❌ No
*.test.tsxor*.test.tsfiles infrontend/src/ - ❌ No
pytest.iniorconftest.py - ❌ No
[tool.pytest.ini_options]section inpyproject.toml - ❌ No CI workflow running tests in
.github/
The only test files in the repository are inside .venv/Lib/site-packages/ and frontend/node_modules/, which belong to third-party libraries, not this project.
Why This Matters
- No regression protection — PRs could silently break the
/health,/api/health, or/api/queryendpoints without detection - Code review burden — reviewers must manually verify correctness for every change
- CI/CD blocked — cannot set up automated test pipelines without tests to run
- Contributor confidence — new contributors hesitate to refactor code when there are no tests to catch breakage
- Production risk — the existing health check endpoints (
/health,/api/health) and the query pipeline have zero test coverage
Proposed Solution
Add a tests/ directory inside backend/ with initial test coverage for the existing endpoints and modules.
Suggested structure:
backend/
└── tests/
├── init.py
├── conftest.py # Shared fixtures (test client, mock env)
├── test_health.py # Tests for /health and /api/health
├── test_query.py # Tests for the query endpoint
└── test_knowledgespace_api.py # Tests for the KS API wrapper
Minimum initial tests should cover:
GET /healthreturns 200 with{"status": "healthy"}GET /api/healthreturns 200 with status and feature flags- Query endpoint exists and accepts POST
- Invalid or empty queries return appropriate error codes not 500
- Unknown routes return 404
Also add pytest to dev dependencies in pyproject.toml, a [tool.pytest.ini_options] configuration section, and a Run Tests section in the README.
I'd Like to Work on This
I'm happy to submit a PR with the initial test setup and baseline tests for the health endpoints. This would establish the testing foundation that other contributors can build on as the project grows.