Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
43 lines
997 B
Markdown
43 lines
997 B
Markdown
# 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 |
|