# Storage Backend Tests ## Test Structure ### Unit Tests (storage/src/backend.rs) - test_backend_initialization - test_put_and_get_object - test_delete_object ### Integration Tests (storage/tests/) - integration_tests.rs - Handler tests - test_utils.rs - Test utilities ## Running Tests ```bash # Start test services docker-compose -f docker-compose.test.yml up -d # Run tests cd storage && ./scripts/run_tests.sh # Or manually export TEST_DATABASE_URL="postgresql://postgres:postgres@localhost:5432/madbase_test" export TEST_S3_ENDPOINT="http://localhost:9000" cargo test --lib storage::backend -- --ignored ``` ## Requirements - PostgreSQL 15+ - MinIO or S3-compatible service ## Environment Variables | Variable | Default | |----------|---------| | TEST_DATABASE_URL | postgresql://postgres:postgres@localhost:5432/madbase_test | | TEST_S3_ENDPOINT | http://localhost:9000 | | TEST_S3_ACCESS_KEY | minioadmin | | TEST_S3_SECRET_KEY | minioadmin | | TEST_S3_BUCKET | madbase-test |