Problem Statement / Context
The project involves three highly coupled systems: VS Code, FastAPI, and Telegram. Manual testing is currently required to verify that an extension save propagates to Telegram. As the project scales, this manual QA process is unsustainable and will lead to regressions in production.
Proposed Solution
Introduce a robust Integration Testing suite using pytest and httpx to simulate the full user journey without requiring real Telegram or GitHub credentials during CI.
Technical Implementation Details
- Implement
respx or responses to mock the GitHub REST API (Contents, Git Data, Pulls).
- Implement a mock Telegram update generator that sends JSON payloads to the
/webhook endpoint simulating a user tapping inline buttons or sending messages.
- Test the full flow:
Simulate VS Code Sync -> Simulate Telegram /files command -> Simulate Telegram 'Done' -> Simulate Telegram 'Commit' -> Assert Mock GitHub API received correct Create Commit payload.
Acceptance Criteria
Impact & Risks
- Risk: Maintaining mocks for PyGithub can be tedious. Using a record/replay tool like VCR.py might be preferable to manual mocking.
Problem Statement / Context
The project involves three highly coupled systems: VS Code, FastAPI, and Telegram. Manual testing is currently required to verify that an extension save propagates to Telegram. As the project scales, this manual QA process is unsustainable and will lead to regressions in production.
Proposed Solution
Introduce a robust Integration Testing suite using
pytestandhttpxto simulate the full user journey without requiring real Telegram or GitHub credentials during CI.Technical Implementation Details
respxorresponsesto mock the GitHub REST API (Contents, Git Data, Pulls)./webhookendpoint simulating a user tapping inline buttons or sending messages.Simulate VS Code Sync -> Simulate Telegram /files command -> Simulate Telegram 'Done' -> Simulate Telegram 'Commit' -> Assert Mock GitHub API received correct Create Commit payload.Acceptance Criteria
tests/integration/directory is created.main.Impact & Risks