This directory contains Docker configurations for testing the dependency-installer CLI.
Pre-configured Ubuntu 24.04 image with all operating system prerequisites installed.
Purpose: This Dockerfile represents the operating system dependencies (pre-conditions) required before using the dependency installers. It includes:
- System packages:
ca-certificates,sudo,curl,build-essential - Rust toolchain:
nightly-2025-10-15installed via rustup - PATH configuration for cargo binaries
The tests verify that given these OS pre-conditions, the installers can successfully install their target dependencies (cargo-machete, OpenTofu, Ansible, LXD).
Usage in tests:
let image = GenericImage::new("ubuntu", "24.04")
.with_wait_for(WaitFor::message_on_stdout("Ready"));The Docker-based integration tests verify that the installers work correctly given the declared OS pre-conditions:
- Pre-built Image: Use
ubuntu-24.04.Dockerfilewith all OS dependencies pre-installed - Build Binary:
cargo build --bin dependency-installer - Copy Into Container: Use testcontainers to copy binary into pre-configured container
- Test Installers: Run
installcommands and verify successful installation - Verify Detection: Use
checkcommand to confirm installations are detected
This approach ensures:
- Fast test execution (OS dependencies installed once during image build)
- Clear documentation of required OS pre-conditions (declared in Dockerfile)
- Confidence that installers work in production environments matching the Dockerfile
cd packages/dependency-installer
docker build -f docker/ubuntu-24.04.Dockerfile -t dependency-installer-test:ubuntu-24.04 .# Run all Docker-based integration tests
cd packages/dependency-installer
cargo test --test docker_check_command
# Run a specific test
cargo test --test docker_check_command test_check_all_reports_missing_dependenciesThe tests use testcontainers to:
- Automatically start and stop Docker containers
- Copy the compiled binary into containers
- Execute commands and capture output
- Verify exit codes and output messages
This ensures tests run in isolated, reproducible environments.
tests/docker_check_command.rs- Integration tests using this infrastructuretests/containers/- Container helper utilities