Skip to content

feat: add Docker-based e2e install test#55

Open
omargallob wants to merge 3 commits into
mainfrom
feat/e2e-docker-test
Open

feat: add Docker-based e2e install test#55
omargallob wants to merge 3 commits into
mainfrom
feat/e2e-docker-test

Conversation

@omargallob

Copy link
Copy Markdown
Owner

Summary

Adds a Go-based end-to-end test that validates the full devops-starter install flow inside a clean Ubuntu 24.04 Docker container.

What it tests

  1. devops-starter setup --non-interactive — config creation
  2. devops-starter install --yes — full tool installation (all enabled groups)
  3. Verification — for every registered tool:
    • Binary exists on PATH (using GetInstallName())
    • Version probe runs successfully (reuses state.DetectVersionAtPath)
    • Installed version matches registry version
    • GH extensions verified via gh extension list

Architecture

Component Location Runs where
Verifier binary tests/e2e/cmd/verify/main.go Inside Docker container
Dockerfile tests/e2e/Dockerfile Built in CI/locally
Workflow .github/workflows/e2e.yml GitHub Actions
Makefile target make test-e2e Local development

The verifier imports internal/registry, internal/state, and pkg/tooldef directly — no JSON parsing or shell scripting needed. It's always in sync with the tool catalog.

Workflow trigger

  • Weekly cron: Sundays 3am UTC on main
  • Manual: workflow_dispatch for on-demand runs

Local testing

make test-e2e                       # all groups
E2E_GROUPS=utilities make test-e2e  # single group (fast iteration)

Features

  • E2E_GROUPS env var for filtering groups during testing
  • Mise shim activation for mise-managed tools
  • GH extension detection (copilot-cli via gh extension list)
  • Summary table with pass/fail/warn/skip counts
  • Platform filtering (skips tools not supported on linux/amd64)
  • Non-root user in Docker (realistic install scenario)

Local test results

Validated locally with E2E_GROUPS=utilities:

  • Setup + config creation: OK
  • Install invocation: OK (5/15 tools installed; failures are eget asset pattern issues on ARM Docker, not e2e bugs)
  • Verify binary runs, reports results, exits with correct code

Files

  • tests/e2e/cmd/verify/main.go — Go verifier binary (230 lines)
  • tests/e2e/cmd/verify/BUILD.bazel — Bazel target (Gazelle-generated)
  • tests/e2e/Dockerfile — Ubuntu 24.04 base image
  • .github/workflows/e2e.yml — Weekly CI workflow
  • Makefile — Added test-e2e target
  • .gitignore — Ignore cross-compiled binaries in tests/e2e/

Add a Go-based e2e test that validates the full devops-starter install
flow inside a clean Ubuntu 24.04 Docker container:

1. devops-starter setup --non-interactive
2. devops-starter install --yes
3. Verify every registered tool: binary on PATH + version match

Components:
- tests/e2e/cmd/verify/main.go: Go verifier binary that imports the
  registry and state packages directly (no shell parsing needed)
- tests/e2e/Dockerfile: Ubuntu 24.04 with curl/git/unzip, non-root user
- .github/workflows/e2e.yml: Weekly cron (Sundays 3am UTC) + manual dispatch
- Makefile test-e2e target for local testing

The verifier supports E2E_GROUPS env var for filtering (e.g., E2E_GROUPS=utilities
for fast iteration). It uses existing version probes from internal/state for
accurate detection and reports a pass/fail/skip summary table.

Local testing:
  make test-e2e                    # all groups
  E2E_GROUPS=utilities make test-e2e  # single group
- Replace 'go build' with 'bazel build --config=linux_amd64' in Makefile
- Single bazel build command for both targets in CI workflow
- Add //tests:__subpackages__ visibility to internal/registry and
  internal/config BUILD.bazel files
Tests cover:
- groupMatchesFilter: exact match, multi-group, no match, trimming
- statusIcon: all status values
- printResults: exit codes (all pass, one fail, skipped, warns)
- verifyTool: binary not found, binary exists (no probe), InstallName override
- verifyGhExtension: gh not installed, extension found in list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant