Skip to content

test: Add integration tests and fix bugs found by them#59

Merged
mojatter merged 2 commits intomainfrom
feat/integration-tests
Apr 13, 2026
Merged

test: Add integration tests and fix bugs found by them#59
mojatter merged 2 commits intomainfrom
feat/integration-tests

Conversation

@mojatter
Copy link
Copy Markdown
Owner

Summary

Depends on #57.

  • Add //go:build integtest integration tests for s3, gcs, and azblob backends
  • Fix four bugs discovered during integration testing:
    • s3: HeadObject 404 now correctly maps to s2.ErrNotExist (was only handling NoSuchKey, not NotFound)
    • s3: Buffer PutObject body into bytes.Reader so the AWS SDK can seek for payload signing over HTTP endpoints
    • s3api server: Support x-amz-metadata-directive in CopyObjectREPLACE uses request headers, COPY (default) preserves source metadata
    • azblob: Lowercase metadata keys on read (Azure normalizes them to Title-Case)
  • Fix s2test metadata keys to avoid hyphens (rejected by Azure)

Running integration tests

# S3 (against AWS)
S2_TEST_S3_BUCKET=my-bucket go test -tags integtest ./s3/...

# S3 (against local s2-server)
S2_TEST_S3_BUCKET=my-bucket S2_TEST_S3_ENDPOINT=http://localhost:9000 \
  S2_TEST_S3_ACCESS_KEY_ID=user S2_TEST_S3_SECRET_ACCESS_KEY=pass \
  go test -tags integtest ./s3/...

# GCS
S2_TEST_GCS_BUCKET=my-bucket go test -tags integtest ./gcs/...

# Azure Blob Storage
S2_TEST_AZBLOB_CONTAINER=my-container \
  S2_TEST_AZBLOB_ACCOUNT_NAME=acct S2_TEST_AZBLOB_ACCOUNT_KEY=key \
  go test -tags integtest ./azblob/...

Test plan

  • All unit tests pass
  • golangci-lint run ./... reports 0 issues
  • Integration tests pass: AWS S3, S2 server (HTTP), GCS, Azure Blob Storage

@mojatter mojatter force-pushed the feat/integration-tests branch from 0dd951f to 7890737 Compare April 13, 2026 07:14
- Buffer PutObject body into bytes.Reader so the AWS SDK can
  seek for payload signing over HTTP (non-TLS) endpoints
- Support x-amz-metadata-directive in CopyObject handler:
  REPLACE uses request headers, COPY (default) preserves
  source metadata
@mojatter mojatter force-pushed the feat/integration-tests branch from 7890737 to 66b8055 Compare April 13, 2026 07:29
- Add Go SDK test container (Dockerfile.sdk) to E2E suite, running
  s3 integration tests against s2-server over HTTP
- Add metadata E2E cases: PutObjectWithMetadata,
  CopyObjectPreservesMetadata, CopyObjectReplaceMetadata
- Update Makefile to run both AWS CLI and SDK tests in test-e2e
@mojatter mojatter force-pushed the feat/integration-tests branch from 7eac0c6 to a6905cd Compare April 13, 2026 07:49
@mojatter mojatter merged commit e462bb6 into main Apr 13, 2026
2 checks passed
@mojatter mojatter deleted the feat/integration-tests branch April 13, 2026 07:54
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.

1 participant