Test/57 add mock GitHub api server - #1021
Open
TanishaD111 wants to merge 6 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR closes issue #57. The
GitHubToolin agent/tools/github_tool.py calls the live GitHub REST API (https://api.github.com) to fetch repository metadata, so any integration test that exercises it needs real network access and is subject to GitHub's rate limits and auth. As a result, those tests are skipped in CI, there is currently notests/integration/test_github_tool.pyand notests/fixtures/github_responses/directory, leaving the tool's request handling and error paths (404, 403/rate limit) untested by automation. The fix is to stand up a lightweight local mock HTTP server (pytest-httpserver) that serves canned JSON fixtures for GitHub endpoints and to point the tool'sbase_urlat it, so the GitHub tool tests can run deterministically and offline in CI without hitting the real API.Issue
Closes #57
Changes
Testing
make test-unit)make test-integration)make lint)make typecheck)Some of these errors are not from my files. The make test-integration passes all 14 tests for my issue.
Screenshots / Demo
n/a
Notes for Reviewers
n/a