-
Notifications
You must be signed in to change notification settings - Fork 729
[GH-2348][Python] Make STAC tests resilient to external server failures #2349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GH-2348][Python] Make STAC tests resilient to external server failures #2349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors STAC tests to use mock clients instead of real external STAC servers, making the tests more reliable and resilient to network failures. The change improves test stability by eliminating dependencies on external services.
- Created mock implementations of STAC Client and CollectionClient
- Refactored all STAC tests to use
@patch
decorators with mock clients - Replaced external server calls with predictable mock responses
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
python/tests/stac/test_mock_fixtures.py | Introduces mock classes for STAC Client, CollectionClient, and related fixtures |
python/tests/stac/test_collection_client.py | Updates all CollectionClient tests to use mocked clients instead of external servers |
python/tests/stac/test_client.py | Updates all Client tests to use mocked clients instead of external servers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The Scala and Java tests also suffer from the same issue. Do you plan to solve them too? If you plan to solve them in another PR, that's fine too! |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Yes, I will create another PR to address scala / java tests. |
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject
. Closes #<issue_number>What changes were proposed in this PR?
This PR refactors the STAC tests to use mock clients instead of real external STAC servers, making the tests more reliable and faster.
test_mock_fixtures.py
with mock implementations of STAC Client and CollectionClienttest_client.py
to use@patch
decorators with mock clientstest_collection_client.py
to use@patch
decorators with mock clientsHow was this patch tested?
Did this PR include necessary documentation updates?