test: add S3 e2e tests with testcontainers-go and MinIO#434
Open
lvlcn-t wants to merge 1 commit into
Open
Conversation
3e05eb4 to
100906a
Compare
This was referenced May 10, 2026
d1f8db1 to
6044698
Compare
100906a to
fcc0025
Compare
Add end-to-end tests that exercise the S3 interactor against a real MinIO container started via testcontainers-go. Tests are guarded by //go:build e2e so they do not run during normal go test ./... Test cases: - Full lifecycle: post -> fetch -> put -> fetch -> delete -> fetch - ETag caching: verify 304 cache hit on unchanged objects - Prefix filtering: only prefixed .json files returned - Concurrent registration: 10 goroutines posting simultaneously - Unhealthy target filtering: old LastSeen round-trips correctly Also adds .github/workflows/e2e_s3.yml to run these tests in CI on changes to the S3 package or e2e/s3/ directory.
fcc0025 to
3fce30a
Compare
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.
Motivation
The S3 interactor (PR #431) has comprehensive unit tests using
httptest.Servermocks, but no integration tests against a realS3-compatible backend. E2E tests catch issues that mocks cannot:
serialization edge cases, authentication flows, and real S3 API
behaviour (ETag handling, prefix semantics, concurrent access).
Stack: PR 2/4 — builds on #431 (S3 interactor + static auth).
Changes
e2e/s3/s3_test.gowith//go:build e2etag — tests runagainst a real MinIO container started via testcontainers-go
.github/workflows/e2e_s3.yml— CI workflow triggered onchanges to
pkg/sparrow/targets/remote/s3/**ore2e/s3/**testcontainers-goandtestcontainers-go/modules/miniodependencies
Test cases
.jsonfiles returnedLastSeenround-tripscorrectly for manager-level filtering
All 5 tests pass locally (~15s including container startup).
For additional information look at the commits.
Tests done
TODO