Repository navigation
Make unit tests run offline and add HTTP request timeouts - #225
Open
tejasng053 wants to merge 1 commit into
Open
tejasng053 wants to merge 1 commit into
tejasng053 wants to merge 1 commit into
Conversation
Fixes aboutcode-org#188 Signed-off-by: tejasng053 <tejasng053@gmail.com>
This branch has not been deployed
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.
What's changed?
Three unit tests make live requests to pub.dev or CocoaPods, so offline runs fail and network problems can stall the suite. The CocoaPods tests mock the utility module's
get_response, but miss the separately imported reference infetchcode.package.Mock those missing calls using the existing podspec fixtures, mock the pub.dev existence check, and add an automatic fixture that fails unexpected HTTP requests. The package parsing and expected results still run unchanged.
Also apply a shared 30-second timeout to all seven direct Requests calls in FetchCode's download and metadata helpers, as requested in the issue. This bounds connection setup and read inactivity, not total download duration. Add 21 regression cases covering timeout arguments, response decoding, error propagation, and preservation of an existing file after a timed-out download. Document the behavior and update the changelog.
Related issue
Fixes #188
Verification before publication
ffbd683: blocking HTTP requests produced 3 failures and 153 passes, identifying the pub.dev test and both CocoaPods tests.make checkpassed: pycodestyle, isort, and Black.git diff --checkand a review of all seven direct Requests call sites passed.Checklist
The last checkbox awaits remote CI; all local checks above passed. Prepared with Codex assistance, with the implementation and complete diff reviewed before publication.