Skip to content

Conversation

@groldan
Copy link
Contributor

@groldan groldan commented Oct 29, 2025

This adds integration tests for all COG RangeReader implementations using testcontainers to spin up emulated storage backends (Nginx for HTTP, Azurite for Azure, fake-gcs-server for Google Cloud Storage, LocalStack and MinIO for
S3). Each storage backend runs in its own package to allow running tests selectively via Maven profiles (cog-http, cog-s3, cog-azure, cog-gs, cog-all).

The tests are parameterized to run with both DefaultCogImageInputStream and CachingCogImageInputStream, though the caching variant had to be disabled in all integration tests due to an ArrayIndexOutOfBoundsException in the CachingCogImageInputStream.read() method when copying array data.

AzureConfigurationProperties was extended to support the azure.reader.serviceurl property (lowercase, as required by PropertyLocator) to allow pointing the Azure client to the Azurite emulator instead of real Azure storage. Similarly, BlobCache was updated to check for a gs.reader.host system property to redirect Google Cloud Storage requests to the fake-gcs-server emulator.

A GitHub Actions workflow was added to run these tests in CI, with each profile running in a separate matrix job to parallelize execution and avoid potential issues with testcontainers cleanup between runs.

@groldan groldan force-pushed the cog_integration_tests branch 3 times, most recently from f917da7 to a6cf629 Compare October 29, 2025 21:50
This adds integration tests for all COG range reader implementations using
testcontainers to spin up emulated storage backends (Nginx for HTTP, Azurite
for Azure, fake-gcs-server for Google Cloud Storage, LocalStack and MinIO for
S3). Each storage backend runs in its own package to allow running tests
selectively via Maven profiles (cog-http, cog-s3, cog-azure, cog-gs, cog-all).

The tests are parameterized to run with both DefaultCogImageInputStream and
CachingCogImageInputStream, though the caching variant had to be disabled in
all integration tests due to an ArrayIndexOutOfBoundsException in the
CachingCogImageInputStream.read() method when copying array data.

Several tests inherited from the base class also had to be ignored because
DefaultCogImageInputStream throws a NullPointerException when calling methods
like getNumImages() or getWidth() - it seems the stream only works correctly
when used directly by ImageReader.read() and doesn't properly initialize its
internal data structures for other metadata queries.

AzureConfigurationProperties was extended to support the azure.reader.serviceurl
property (lowercase, as required by PropertyLocator) to allow pointing the Azure
client to the Azurite emulator instead of real Azure storage. Similarly, BlobCache
was updated to check for a gs.reader.host system property to redirect Google Cloud
Storage requests to the fake-gcs-server emulator.

A GitHub Actions workflow was added to run these tests in CI, with each profile
running in a separate matrix job to parallelize execution and avoid potential
issues with testcontainers cleanup between runs.
@groldan groldan force-pushed the cog_integration_tests branch from a6cf629 to 806064d Compare October 29, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants