Skip to content

Conversation

zhangfengcdt
Copy link
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • Yes, and the PR name follows the format [GH-XXX] my subject. Closes #<issue_number>

What changes were proposed in this PR?

This PR makes STAC tests resilient to external server failures by implementing mock-based testing for Python and local test resources for Scala, ensuring tests run reliably without network dependencies.

  • Created mock STAC collection JSON files in /spark/common/src/test/resources/stac/:
  • 6 collection files (sentinel-2, vegetation, wildfire, copernicus-dem, naip, earthview)
  • 1 items file with 10 mock STAC items

How was this patch tested?

  • Updated StacDataSourceTest.scala to use local mock files instead of remote URLs
  • Updated StacBatchTest.scala to use local resource files with file:// protocol
  • Updated StacPartitionReaderTest.scala to use mock items file

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

Copy link
Contributor

@Copilot Copilot AI left a 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 improves test reliability by replacing external STAC API dependencies with local mock resources, ensuring tests can run without network access and won't fail due to external server issues.

  • Replaced remote STAC collection URLs with local mock JSON files
  • Created comprehensive mock STAC data including collections and items
  • Updated test methods to use file:// protocol for local resources

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
StacPartitionReaderTest.scala Added helper method for resource paths and replaced HTTPS endpoint with mock items file
StacDataSourceTest.scala Added helper method and replaced remote collection URLs with local mock files
StacBatchTest.scala Updated collection URLs and item links to use local mock resources
sentinel-2-items.json Mock STAC items collection with 10 realistic Sentinel-2 features
wildfire-collection.json Mock wildfire STAC collection with metadata and links
vegetation-collection.json Mock vegetation STAC collection with California Forest Observatory data
sentinel-2-pre-c1-l2a.json Mock Sentinel-2 STAC collection with Earth Search metadata
naip.json Mock NAIP collection with aerial imagery metadata
earthview-catalog.json Mock Satellogic EarthView catalog
copernicus-dem.json Mock Copernicus DEM collection with elevation data

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jiayuasu jiayuasu added this to the sedona-1.8.1 milestone Sep 16, 2025
@jiayuasu jiayuasu merged commit 6029bec into apache:master Sep 16, 2025
36 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants