End-to-End Testing
easy-db-lab includes a comprehensive end-to-end test suite that validates the entire workflow from provisioning to teardown.
Running the Test
The end-to-end test is located at bin/end-to-end-test:
./bin/end-to-end-test --cassandra
Command-Line Options
Feature Flags
| Flag | Description |
|---|---|
--cassandra | Enable Cassandra-specific tests |
--spark | Enable Spark EMR provisioning and tests |
--clickhouse | Enable ClickHouse deployment and tests |
--opensearch | Enable OpenSearch deployment and tests |
--all | Enable all optional features |
--ebs | Enable EBS volumes (gp3, 256GB) |
--build | Build Packer images (default: skip) |
Testing and Inspection
| Flag | Description |
|---|---|
--list-steps, -l | List all test steps without running |
--break <steps> | Set breakpoints at specific steps (comma-separated) |
--wait | Run all steps except teardown, then wait for confirmation |
Examples
# List all available test steps
./bin/end-to-end-test --list-steps
# Run full test with all features
./bin/end-to-end-test --all
# Run with Cassandra and pause before teardown
./bin/end-to-end-test --cassandra --wait
# Run with breakpoints at steps 5 and 15
./bin/end-to-end-test --cassandra --break 5,15
# Build custom AMI images and run test
./bin/end-to-end-test --build --cassandra
Test Steps
The test executes approximately 27 steps covering:
Infrastructure
- Build project
- Check version command
- Build packer images (optional)
- Set IAM policies
- Initialize cluster
- Setup kubectl
- Wait for K3s ready
- Verify K3s cluster
Registry and Storage
- Test registry push/pull
- List hosts
- Verify S3 backup
Cassandra
- Setup Cassandra
- Verify Cassandra backup
- Verify restore
- Cassandra start/stop cycle
- Test SSH and nodetool
- Check Sidecar
- Test exec command
- Run stress test
- Run stress K8s test
Optional Services
- Submit Spark job (if
--spark) - Check Spark status (if
--spark) - Start ClickHouse (if
--clickhouse) - Test ClickHouse (if
--clickhouse) - Stop ClickHouse (if
--clickhouse) - Start OpenSearch (if
--opensearch) - Test OpenSearch (if
--opensearch) - Stop OpenSearch (if
--opensearch)
Observability and Cleanup
- Test observability stack
- Teardown cluster
Error Handling
When a test step fails, an interactive menu appears:
- Retry from failed step - Resume from the point of failure
- Start a shell session - Opens a shell with:
easy-db-labcommands availablerebuild- Rebuild just the projectrerun- Rebuild and resume from failed step
- Tear down environment - Run
easy-db-lab down --yes - Exit - Exit the script
AWS Requirements
The test requires:
- AWS profile with sufficient permissions
- VPC and subnet configuration
- S3 bucket for backups and logs
Default Configuration
- Instance count: 3 nodes
- Instance type: c5.2xlarge
- Cassandra version: 5.0 (when enabled)
- Spark workers: 2 (when enabled)
CI Integration
The end-to-end test is designed to run in CI environments:
- Supports non-interactive mode
- Returns appropriate exit codes
- Provides detailed logging
- Cleans up resources on failure