Skip to content

[Chore/Testing]: Establish an E2E testing framework mocking GitHub and Telegram APIs #64

Description

@ErebAsh

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

  • A dedicated tests/integration/ directory is created.
  • A complete happy-path E2E test passes locally.
  • GitHub Actions workflow is configured to run these tests on every Pull Request against main.

Impact & Risks

  • Risk: Maintaining mocks for PyGithub can be tedious. Using a record/replay tool like VCR.py might be preferable to manual mocking.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions