-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Currently, the FastAPI backend (including backend/main.py and the associated API routes) does not appear to have automated tests. This makes it difficult to verify endpoint behavior, detect regressions, and safely extend functionality in the future.
Additionally, there is no CI workflow configured to automatically run tests on pull requests.
Describe the solution you'd like
I would like to:
- Add a structured tests/ directory for the backend
- Use pytest together with fastapi.testclient.TestClient
Implement tests for:
- The root (/) endpoint
- The /api routes defined in report_router
Validate:
- HTTP status codes
- Response structure
- Required fields in returned JSON
- Add a GitHub Actions workflow to automatically run tests on pull requests
This will improve reliability, maintainability, and confidence in future changes.
Describe alternatives you've considered
An alternative would be to rely on manual testing during development. However, automated testing ensures consistent validation and allows easier extension of functionality without introducing regressions.
Additional context
This change will not modify any existing functionality or scientific logic. It will focus solely on improving backend reliability and developer experience by introducing structured automated testing and CI integration.
Vinit Jain
GitHub: @vinitjain2005