161ef94b4f
Sirius CI/CD Pipeline / Merge API Manifest (push) Blocked by required conditions
Sirius CI/CD Pipeline / Build API (${{ matrix.platform }}) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Build UI (${{ matrix.platform }}) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Merge UI Manifest (push) Blocked by required conditions
Sirius CI/CD Pipeline / Build Engine (${{ matrix.platform }}) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Merge Engine Manifest (push) Blocked by required conditions
Sirius CI/CD Pipeline / Build Infra (${{ matrix.service }}, ${{ matrix.platform }}) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Merge Infra Manifest (sirius-postgres) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Merge Infra Manifest (sirius-rabbitmq) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Merge Infra Manifest (sirius-valkey) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Integration Test (push) Blocked by required conditions
Sirius CI/CD Pipeline / Public Stack Contract (push) Blocked by required conditions
Sirius CI/CD Pipeline / Dispatch Demo Deployment (sirius-demo branch) (push) Blocked by required conditions
Sirius CI/CD Pipeline / Dispatch Demo Canary (main branch) (push) Blocked by required conditions
Check engine pin consistency / Dockerfile / CI pin consistency (push) Successful in 8s
Sirius CI/CD Pipeline / Detect Changes (push) Successful in 23s
Sirius CI/CD Pipeline / Guard Registry Namespace (push) Waiting to run
Validate Docker Configuration / Validate Docker Compose Configuration (push) Successful in 47s
6.6 KiB
6.6 KiB
SiriusScan Container Testing Infrastructure
This directory contains comprehensive testing infrastructure for SiriusScan's Docker containerized microservices architecture.
Overview
The testing infrastructure provides automated validation of:
- Container Builds: Individual Docker image builds
- Service Health: Health checks and basic functionality
- Integration: End-to-end service communication
- Configuration: Docker Compose validation
Quick Start
# Run all tests
make test-all
# Run specific test types
make test-build # Test container builds
make test-health # Test service health
make test-integration # Test service integration
# Start development environment
make dev
# Start production environment
make prod
Test Scripts
1. Build Tests (test-build.sh)
Tests individual container builds and Docker Compose configurations.
What it tests:
- Base, development, and production Docker Compose configurations
- sirius-ui production and development builds
- sirius-api runner and development builds
- sirius-engine runtime and development builds
Usage:
./testing/scripts/test-build.sh
Output:
- ✅ PASSED: Configuration validations
- ❌ FAILED: Build failures with detailed logs
- 📊 Summary report with pass/fail counts
2. Health Tests (test-health.sh)
Tests service health checks and basic functionality.
What it tests:
- Container startup and readiness
- Health check endpoints
- Database connectivity (PostgreSQL, Valkey)
- Message queue connectivity (RabbitMQ)
- Service-to-service communication
- Port accessibility
Usage:
# Test base environment
./testing/scripts/test-health.sh
# Test development environment
./testing/scripts/test-health.sh dev
# Test production environment
./testing/scripts/test-health.sh prod
Output:
- 🏥 Health check results for each service
- 🔗 Service communication validation
- 📊 Comprehensive health report
3. Integration Tests (test-integration.sh)
Tests end-to-end service integration and functionality.
What it tests:
- API endpoint functionality
- Database operations
- Service communication flows
- Authentication flows
- Scanning functionality
- Error handling
Usage:
# Test base environment
./testing/scripts/test-integration.sh
# Test development environment
./testing/scripts/test-integration.sh dev
# Test production environment
./testing/scripts/test-integration.sh prod
Output:
- 🔗 API endpoint validation
- 🗄️ Database operation tests
- 🔐 Authentication flow tests
- 🔍 Scanning functionality tests
- ⚠️ Error handling validation
Configuration Files
Docker Compose Configurations
docker-compose.yaml: Base production configuration with health checksdocker-compose.dev.yaml: Development overrides with hot reloading and volume mounts
Test Configuration
testing/scripts/: Test execution scriptstesting/logs/: Test execution logs (auto-created)Makefile: Easy command interface
Test Results
Log Files
All test executions generate detailed logs in testing/logs/:
build_test_YYYYMMDD_HHMMSS.loghealth_test_YYYYMMDD_HHMMSS.logintegration_test_YYYYMMDD_HHMMSS.log
Exit Codes
- 0: All tests passed
- 1: One or more tests failed
Test Reports
Each test script provides:
- Real-time colored output
- Detailed command execution logs
- Pass/fail summary with counts
- Specific failure details
Development Workflow
1. Pre-commit Testing
# Quick validation before committing
make ci-test
2. Full Validation
# Complete validation before deployment
make validate
3. Development Testing
# Start development environment
make dev
# Run health tests
make test-health
# Check logs
make logs
4. Production Testing
# Test production configuration
make build-prod
# Run production health tests
make test-health prod
Troubleshooting
Common Issues
-
Build Failures
- Check Docker daemon is running
- Verify sufficient disk space
- Check network connectivity for git clones
-
Health Check Failures
- Ensure all services are running
- Check port conflicts
- Verify service dependencies
-
Integration Test Failures
- Check database connectivity
- Verify API endpoints are responding
- Check service communication
Debug Commands
# Check service status
make status
# View service logs
make logs
# Check individual container logs
docker compose logs sirius-ui
docker compose logs sirius-api
docker compose logs sirius-engine
Cleanup
# Clean up everything
make clean
# Stop services only
make stop
CI/CD Integration
GitHub Actions Example
name: Container Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Container Tests
run: make ci-test
Jenkins Pipeline Example
pipeline {
agent any
stages {
stage('Build Test') {
steps {
sh 'make test-build'
}
}
stage('Health Test') {
steps {
sh 'make test-health'
}
}
stage('Integration Test') {
steps {
sh 'make test-integration'
}
}
}
}
Best Practices
1. Test Execution Order
- Build Tests: Validate configurations and builds
- Health Tests: Verify basic functionality
- Integration Tests: Test end-to-end flows
2. Environment Testing
- Test all three environments (base, dev, prod)
- Use appropriate environment for each test type
- Clean up between test runs
3. Log Management
- Review logs for detailed failure information
- Archive logs for historical analysis
- Use log rotation for long-running tests
4. Performance Considerations
- Tests run in parallel where possible
- Use appropriate timeouts for service startup
- Clean up test containers and images
Contributing
Adding New Tests
- Create test function in appropriate script
- Add test to main execution flow
- Update documentation
- Test the new test function
Modifying Existing Tests
- Update test logic
- Verify test still passes
- Update documentation if needed
- Test in all environments
Support
For issues with the testing infrastructure:
- Check the troubleshooting section
- Review test logs for specific errors
- Verify Docker and Docker Compose installation
- Check service dependencies and configuration