test(integration): run archduino install end-to-end on archlinux:base

This commit is contained in:
MDietermann
2026-04-13 21:22:29 +02:00
parent 3a4855b92a
commit 40ac730719
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# Minimal Arch image with Go toolchain for building and running archduino.
FROM archlinux:base
RUN pacman -Sy --noconfirm --needed go git ca-certificates
WORKDIR /src
COPY . /src
RUN go build -o /usr/local/bin/archduino ./cmd/archduino
# Run as non-root to exercise user-home paths.
RUN useradd -m tester
USER tester
WORKDIR /home/tester
ENTRYPOINT ["archduino"]

27
test/integration/run.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Build the image and run `archduino install --no-tui --no-sudo` end-to-end.
# Exits non-zero on any failure. Intended for local dev + Plan 4 CI.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
IMAGE=archduino-integration:latest
echo "--- building image"
docker build -f "$SCRIPT_DIR/Dockerfile" -t "$IMAGE" "$REPO_ROOT"
echo "--- run 1: fresh install"
docker run --rm "$IMAGE" install --no-tui --no-sudo
echo "--- run 2: idempotent (marker already present)"
# Persist home across runs via a named volume.
VOL=archduino-integration-home
docker volume create "$VOL" >/dev/null
docker run --rm -v "$VOL":/home/tester "$IMAGE" install --no-tui --no-sudo
docker run --rm -v "$VOL":/home/tester "$IMAGE" install --no-tui --no-sudo
echo "--- assert marker exists in volume"
docker run --rm -v "$VOL":/home/tester --entrypoint test "$IMAGE" -f /home/tester/.cache/archduino/hello.ok
docker volume rm "$VOL" >/dev/null
echo "--- integration test PASSED"