This directory contains tests that span both infrastructure and application layers, validating project-wide concerns and cross-cutting functionality.
Tests in this directory focus on:
- Project-wide configuration validation (root-level Makefile, project structure)
- Tool availability and requirements verification
- Cross-cutting documentation validation
- End-to-end integration testing
These tests validate project-wide components and integration between infrastructure and application layers.
test-e2e.sh- Complete deployment workflow test (infrastructure + application)test-unit-project.sh- Project-wide configuration and structure validation
- Complete Deployment Workflow (
test-e2e.sh)- Infrastructure provisioning (
make infra-apply) - Application deployment (
make app-deploy) - Health validation (
make app-health-check) - Complete system integration
- Duration: ~5-8 minutes
- Infrastructure provisioning (
- Makefile Validation - Tests root-level Makefile syntax
- Tool Requirements - Verifies required and optional tools are available
- Project Structure - Validates overall project organization
- Documentation Structure - Checks cross-cutting documentation
- Test Organization - Validates test directory structure
# Run complete E2E test
make test
# Run project-wide unit tests
./test-unit-project.sh
# Run specific project-wide test categories
./test-unit-project.sh makefile # Makefile only
./test-unit-project.sh tools # Tool requirements only
./test-unit-project.sh structure # Project structure only
./test-unit-project.sh docs # Documentation structure only
./test-unit-project.sh tests # Test organization only✅ Project-wide tests:
- Root-level Makefile validation
- Project structure spanning multiple layers
- Tool availability checks
- Cross-cutting documentation validation
- End-to-end integration tests
- Overall project organization validation
❌ Infrastructure tests (belong in infrastructure/tests/):
- Terraform/OpenTofu configurations
- Cloud-init templates
- Infrastructure provisioning scripts
- VM-level configurations
❌ Application tests (belong in application/tests/):
- Docker Compose file validation
- Application configuration files
- Application deployment scripts
- Service-specific configurations
This test suite is part of a three-layer testing architecture:
- Infrastructure Tests (
infrastructure/tests/) - Infrastructure provisioning - Application Tests (
application/tests/) - Application deployment - Project Tests (
tests/) - Cross-cutting project validation (this directory)
The project tests orchestrate and validate the integration between the other layers.
Command: make test
Duration: ~5-8 minutes
Environment: Deploys real VMs and services
Test Flow:
- Prerequisites Validation - Validates system requirements
- Infrastructure Provisioning - Deploys VM using
make infra-apply - Application Deployment - Deploys tracker using
make app-deploy - Health Validation - Validates all services using
make app-health-check - Cleanup - Destroys infrastructure using
make infra-destroy
Output: Generates detailed log at /tmp/torrust-e2e-test.log
The E2E test exactly mirrors the manual integration testing guide at:
docs/guides/integration-testing-guide.md
It automates the same workflow that developers follow manually, ensuring consistency between automated and manual testing procedures.
When adding new project-wide tests:
- Categorize correctly - Ensure the test spans multiple layers or addresses project-wide concerns
- Follow naming conventions - Use
test_function_name()format - Add to main suite - Include in appropriate test function
- Update help - Add command options if needed
- Document purpose - Explain what the test validates
test_new_project_feature() {
log_info "Testing new project-wide feature..."
local failed=0
# Test implementation here
if [[ ${failed} -eq 0 ]]; then
log_success "New project feature validation passed"
fi
return ${failed}
}