This test suite is designed to perform integration testing for Bacalhau using real docker containers, simulating a production-like environment.
- Uses TestContainers Go library for managing Docker environments
- Implements Testify Go testing suite for structured and extensible tests
- Compiles project binary and builds custom Docker images for testing
- Provides a base suite with common functionality, easily extendable for specific test cases
- Simulates real production usage by executing commands in a jumpbox container
-
Base Suite: Compiles the project binary and builds several Docker images:
- Compute node
- Orchestrator node
- Jumpbox node
-
TestContainers: Used to set up and manage a Docker Compose stack for each test suite.
-
Test Structure:
- Each test suite inherits from the base suite
- Suites have their own Docker Compose stack, shared by all tests within the suite
- Tests within a suite run in series
- Different suites can run in parallel if needed
-
Test Execution:
- Tests use TestContainers' exec-in-container functionality
- Commands are run in the jumpbox container, simulating real-world usage
- No mocking is used, providing high-fidelity test results
To run test suite, you will need to have docker daemon on your local machine, as well as docker compose,
Then:
cd test_integration
./run_locally.sh # Will compile bacalhau binary and run all tests
./run_locally.sh -s # Skip compilation, and run all tests
./run_locally.sh -t TestName # Compile bacalhau binary and Run specific test
./run_locally.sh -c # Compile bacalhau binary only, do not runs tests
./run_locally.sh -s -t TestName # Skip compilation and run specific test