Skip to content

test(github): add live integration test suite #301

@TheRealAgentK

Description

@TheRealAgentK

Background

The github integration was upgraded to SDK 2.0.0 in #274 with 82 new unit tests across 5 domain files. The PR also fixed a live production crash (232 instances since December 2025) caused by the shared @handle_github_errors decorator returning malformed ActionResult on errors instead of ActionError.

The legacy github/tests/test_github.py is a manual asyncio script (python test_github.py <token>) — it does call the real GitHub API but isn't pytest-collectable, has no pytest.mark.integration marker, and isn't excluded from CI through the standard mechanism.

GitHub uses platform OAuth (repo, read:org, gist, admin:repo_hook, workflow), so e2e coverage requires a manually obtained access token (or a fine-grained PAT for the test repo).

Acceptance criteria

  • Convert or replace github/tests/test_github.py with a proper github/tests/test_github_integration.py following the writing-integration-tests skillpytestmark = pytest.mark.integration, live_context fixture, env-var-driven token (GITHUB_ACCESS_TOKEN)
  • Read-only smoke coverage for the major resource families: repos, branches/commits, issues, pull requests, workflows
  • Specifically cover the error contract through @handle_github_errors — e.g. fetch a non-existent repo, invalid token — to verify the decorator returns valid ActionError against real 404/401 responses (the class of bug fix(github): return ActionError instead of malformed ActionResult on errors #274 fixed)
  • Destructive tests (create/update/delete issue, create PR, merge PR, etc.) gated with @pytest.mark.destructive, scoped to a dedicated test repo
  • Token-extraction recipe documented at the top of the test file
  • pytest github/ -m integration passes locally; pytest github/ (default) does not run the integration tests

Priority

High — same defect class is responsible for the 232 production crashes #274 fixed.

Related

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions