📦 Task Note: MinIO Testcontainers Support (task_id:testcontainers.minio_support)#
Task Description:
Add
MinioContainerfromtestcontainers.minioto enable integration tests for MinIO-based services.
Context:
-
CipherSwarm uses MinIO as its object storage backend for attack resources (wordlists, rules, masks, charsets).
-
Existing integration tests use
PostgresContainerfromtestcontainers.postgresqlto spin up isolated environments. -
We need to provide similar test coverage for endpoints that interact with MinIO, particularly:
- Upload flow (presign generation, DB row creation)
- Download access and validation
- Resource import/export logic
- Crackable uploads (Phase 2b/3)
Implementation Tasks:
- Add test dependency:
testcontainers[minio] - Create a
minio_containerpytest fixture usingMinioContainer - Set up the MinIO endpoint (host/port/access keys) as overrideable config for test environment
- Auto-create buckets needed for tests (
wordlists,rules, etc.) - Ensure container fixture is used alongside
postgres_containerin affected integration test modules - Validate that resource endpoints (upload, metadata, linking, ephemeral resource fetches) behave correctly
- Optionally seed a test wordlist or rule file for integration coverage
- Update
tests/integration/test_uploads.pyand related files
Config Integration:
- The
config.pyshould support injectingMINIO_ENDPOINT,MINIO_ACCESS_KEY,MINIO_SECRET_KEY, andMINIO_BUCKET_PREFIXfrom environment or test fixture override. - Consider a base test class or
conftest.pyhelper to centralize test MinIO bootstrapping.
CI Requirements:
- Ensure the MinIO container fixture works in GitHub Actions or CI environment (expose ports, handle healthcheck)
- Include at least one upload + presign + fetch test in
just ci-check
References: