10 KiB
title, description, template, version, last_updated, author, tags, categories, difficulty, prerequisites, related_docs, dependencies, llm_context, search_keywords
| title | description | template | version | last_updated | author | tags | categories | difficulty | prerequisites | related_docs | dependencies | llm_context | search_keywords | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| About Testing in Sirius | Comprehensive guide to the Sirius testing philosophy, infrastructure, and operator-first testing approach for integration and validation testing. | TEMPLATE.about | 1.0.0 | 2025-01-03 | Development Team |
|
|
intermediate |
|
|
|
high |
|
About Testing in Sirius
Overview
Testing in Sirius follows an operator-first philosophy that prioritizes real-world validation over traditional unit testing. Our testing approach focuses on proving that complete systems, processes, and integrations work correctly in realistic scenarios, rather than testing individual code units in isolation.
Testing Philosophy
Operator-First Approach
Core Principle: Tests should validate that operators can successfully use the system to accomplish real tasks.
What This Means:
- Tests simulate actual user workflows and operations
- Validation focuses on end-to-end functionality
- Tests prove that complete processes work as intended
- Results must be actionable and meaningful to operators
Example: Instead of testing a scanner function in isolation, we test that the scanner can be invoked standalone, process real data, and produce valid results that an operator would actually use.
Integration-Focused Testing
Primary Goal: Validate that different components work together correctly.
Testing Scope:
- Cross-service communication
- Data flow between components
- End-to-end process validation
- Real-world scenario simulation
Benefits:
- Catches integration issues that unit tests miss
- Validates complete workflows
- Ensures system reliability for operators
- Provides confidence in production deployments
Current Testing Infrastructure
Container Testing
Location: testing/container-testing/
Purpose: Validate Docker container builds, health, and integration
What's Tested:
- Docker Compose configuration validation
- Individual container builds (all targets)
- Service health checks
- Cross-service communication
- Integration testing
Automation:
make test-all- Complete test suitemake test-build- Build validationmake test-health- Health checksmake test-integration- Integration testing
Documentation Testing
Location: testing/documentation/
Purpose: Validate documentation completeness, accuracy, and consistency
What's Tested:
- YAML front matter completeness
- Template compliance
- Index completeness
- Link validation
- Metadata validity
Automation:
make lint-docs- Full documentation validationmake lint-docs-quick- Quick validationmake lint-index- Index completeness check
Pre-commit Validation
Location: scripts/git-hooks/
Purpose: Quick validation before commits
What's Tested:
- Docker Compose configuration validity
- Basic syntax checks
- Quick documentation validation
- Code formatting
Testing Standards
Test Structure
Standalone Execution: Every test must be able to run independently without dependencies on the main codebase.
Real Data: Tests should use realistic data and scenarios, not mocked or synthetic data.
Actionable Results: Test results must provide clear, actionable information for operators and developers.
Automated Validation: All tests must be automatable and runnable via command-line tools.
Test Categories
1. Build Validation Tests
Purpose: Ensure components can be built correctly
Examples:
- Docker container builds
- Multi-stage build validation
- Architecture compatibility
- Dependency resolution
Validation Criteria:
- Build completes without errors
- All build targets work correctly
- Images are properly tagged
- Dependencies are resolved
2. Health Validation Tests
Purpose: Ensure services start and remain healthy
Examples:
- Service startup validation
- Health endpoint checks
- Resource availability
- Graceful shutdown
Validation Criteria:
- Services start within expected time
- Health endpoints respond correctly
- No critical errors in logs
- Proper resource utilization
3. Integration Validation Tests
Purpose: Ensure components work together correctly
Examples:
- Cross-service communication
- Database connectivity
- Message queue functionality
- API endpoint integration
Validation Criteria:
- Services can communicate
- Data flows correctly
- APIs respond as expected
- Error handling works
4. Process Validation Tests
Purpose: Ensure complete workflows function correctly
Examples:
- End-to-end scanning processes
- Data processing pipelines
- User authentication flows
- Deployment processes
Validation Criteria:
- Complete workflows execute successfully
- Results are valid and usable
- Error conditions are handled
- Performance meets requirements
Future Testing Objectives
Next 3 Months
Priority 1: Scanner Testing Infrastructure
- Standalone scanner execution tests
- Real vulnerability detection validation
- Output format verification
- Performance benchmarking
Priority 2: API Testing Infrastructure
- Endpoint functionality validation
- Authentication and authorization testing
- Data validation and error handling
- Performance and load testing
Priority 3: Engine Testing Infrastructure
- Agent communication testing
- Task execution validation
- Resource management testing
- Error recovery testing
Long-term Vision
Comprehensive Test Coverage: Every major component and process will have dedicated testing infrastructure.
Automated Validation: All tests will be integrated into CI/CD pipelines and pre-commit hooks.
Operator Confidence: Tests will provide operators with confidence that the system works correctly in production.
Continuous Improvement: Testing infrastructure will evolve with the system to maintain high quality standards.
Testing Best Practices
For Test Developers
- Start with Real Scenarios: Design tests around actual operator workflows
- Use Real Data: Test with realistic data, not synthetic or mocked data
- Validate Complete Processes: Test end-to-end functionality, not just individual components
- Make Tests Standalone: Ensure tests can run independently without external dependencies
- Provide Clear Results: Test output should be actionable and meaningful
For System Developers
- Design for Testability: Build components that can be tested independently
- Expose Health Endpoints: Provide clear health and status indicators
- Use Standard Interfaces: Follow consistent patterns for APIs and data formats
- Document Dependencies: Clearly document what each component needs to function
- Plan for Validation: Consider how operators will validate that components work correctly
For Operators
- Run Tests Regularly: Use testing infrastructure to validate system health
- Understand Test Results: Learn to interpret test output for troubleshooting
- Report Issues: Use test failures to identify and report problems
- Validate Changes: Run tests after any system changes or updates
- Trust the Tests: Use test results to make operational decisions
Testing Tools and Commands
Container Testing
# Full test suite
cd testing/container-testing
make test-all
# Individual tests
make test-build
make test-health
make test-integration
# Quick validation
make build-all
Documentation Testing
# Full documentation validation
cd testing/documentation
make lint-docs
# Quick validation
make lint-docs-quick
make lint-index
Pre-commit Validation
# Automatic validation
git commit # Runs quick validation automatically
# Manual validation
cd testing/container-testing
make build-all
make lint-docs-quick
Integration with Development
CI/CD Pipeline
Pre-commit: Quick validation (~30 seconds)
- Docker Compose configuration validation
- Basic syntax checks
- Quick documentation validation
CI/CD: Full testing (~5-10 minutes)
- Complete Docker builds
- Integration testing
- Health checks
- Cross-service communication
Local Development
Available Commands: Developers can run full test suites locally when needed
Testing Strategy: Quick validation for commits, full testing for CI and local validation
Troubleshooting
Common Issues
| Issue | Symptoms | Solution |
|---|---|---|
| Test Failures | Tests fail unexpectedly | Check logs, verify dependencies, run individual tests |
| Build Issues | Docker builds fail | Check Dockerfile syntax, verify base images |
| Integration Issues | Services can't communicate | Check network configuration, verify service health |
| Documentation Issues | Linting fails | Check YAML front matter, verify template compliance |
Debugging Commands
# Check test logs
cd testing/container-testing
make logs
# Run individual tests
make test-build
make test-health
# Check documentation
cd testing/documentation
make lint-docs
Getting Help
Documentation
- README.container-testing.md - Container testing guide
- README.documentation-testing.md - Documentation testing guide
- README.cicd.md - CI/CD pipeline guide
Common Issues
- Check test logs for specific error messages
- Verify all dependencies are available
- Ensure proper environment configuration
- Run tests individually to isolate issues
Support
- Review testing documentation for guidance
- Check CI/CD logs for automated test results
- Use local testing for debugging and validation
- Report issues with specific test output and logs
This testing philosophy guide follows the Sirius Documentation Standard. For specific testing implementation details, see README.container-testing.md and README.documentation-testing.md.