Skip to content

test: add S3 e2e tests with testcontainers-go and MinIO#434

Open
lvlcn-t wants to merge 1 commit into
feat/s3-target-managerfrom
feat/s3-e2e-tests
Open

test: add S3 e2e tests with testcontainers-go and MinIO#434
lvlcn-t wants to merge 1 commit into
feat/s3-target-managerfrom
feat/s3-e2e-tests

Conversation

@lvlcn-t
Copy link
Copy Markdown
Collaborator

@lvlcn-t lvlcn-t commented May 10, 2026

Motivation

The S3 interactor (PR #431) has comprehensive unit tests using
httptest.Server mocks, but no integration tests against a real
S3-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

  • Add e2e/s3/s3_test.go with //go:build e2e tag — tests run
    against a real MinIO container started via testcontainers-go
  • Add .github/workflows/e2e_s3.yml — CI workflow triggered on
    changes to pkg/sparrow/targets/remote/s3/** or e2e/s3/**
  • Add testcontainers-go and testcontainers-go/modules/minio
    dependencies

Test cases

  1. Full lifecycle — post → fetch → put → fetch → delete → fetch
  2. ETag caching — verify cache hit on unchanged objects
  3. Prefix filtering — only prefixed .json files returned
  4. Concurrent registration — 10 goroutines posting simultaneously
  5. Unhealthy target filtering — old LastSeen round-trips
    correctly for manager-level filtering

All 5 tests pass locally (~15s including container startup).

For additional information look at the commits.

Tests done

  • Unit tests succeeded
  • E2E tests succeeded (all 5 pass against MinIO container)

TODO

  • I've assigned this PR to myself
  • I've labeled this PR correctly

@lvlcn-t lvlcn-t self-assigned this May 10, 2026
@lvlcn-t lvlcn-t added feature Introduces a new feature area/target-manager Issues/PRs related to the TargetManager labels May 10, 2026
@lvlcn-t lvlcn-t force-pushed the feat/s3-e2e-tests branch from 3e05eb4 to 100906a Compare May 10, 2026 19:55
@lvlcn-t lvlcn-t force-pushed the feat/s3-target-manager branch from d1f8db1 to 6044698 Compare May 14, 2026 18:22
@lvlcn-t lvlcn-t force-pushed the feat/s3-e2e-tests branch from 100906a to fcc0025 Compare May 14, 2026 18:22
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.
@lvlcn-t lvlcn-t force-pushed the feat/s3-e2e-tests branch from fcc0025 to 3fce30a Compare May 14, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/target-manager Issues/PRs related to the TargetManager feature Introduces a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant