Skip to content

Create Docker Test Infrastructure #116

@josecelano

Description

@josecelano

Parent Issue: #113 - Create Dependency Installation Package for E2E Tests
Depends On: #115 - Create CLI Binary with Check Command (Issue 1-1-2)
Epic: #112 - Refactor and Improve E2E Test Execution

Overview

Create Docker-based testing infrastructure to verify the CLI binary works correctly in a clean Ubuntu environment. This ensures the binary can detect missing dependencies and provides confidence before implementing installation logic.

This is Phase 3 of 4 for building the dependency installation package.

Objectives

  • Create Dockerfile based on ubuntu:24.04
  • Set up container helpers for file operations
  • Write Docker-based tests for the CLI binary
  • Test detection of missing and installed tools
  • Verify exit codes and error messages

Key Components

Dockerfile:

  • Base: ubuntu:24.04
  • Installs: build-essential, curl
  • Does NOT install: cargo-machete, OpenTofu, Ansible, LXD (tests detection of missing deps)

Container Helpers:

  • Copy existing helpers from src/testing/e2e/containers/
  • copy_file_to_container() - Copy binary to container
  • Container startup and cleanup utilities

Tests:

  • Test binary detects missing dependencies correctly
  • Test binary reports installed dependencies correctly
  • Verify exit codes (0 for all present, 1 for missing deps)

Acceptance Criteria

  • Pre-commit checks pass
  • Dockerfile builds successfully
  • Docker tests run and pass
  • CLI binary correctly detects missing tools
  • Exit codes are correct in all scenarios
  • Tests are documented and maintainable

Time Estimate

2-3 hours

Related Documentation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions