Files
computer-playbook/roles/svc-runner/files/test/test.sh
kevinveenbirkenbachandClaude Opus 4.8 2b44d9f7f9 fix(test-e2e-cli): stage CLI test assets on the node and SPOT the node src dir
The per-role existence asserts and the test script path were controller paths evaluated on the remote swarm node (docker connection, node checkout under /opt/infinito-nexus), so every svc-runner swarm job failed on a stat that could never succeed. Assert both required assets in one localhost-delegated loop, stage roles/<app>/files/test onto the node, run the staged script, and delegate the optional defaults/vars probes to the controller (they silently skipped before). svc-runner's test reaches its sources via RUNNER_SRC_DIR (compose: INFINITO_SRC_DIR dev-container mount; swarm: node checkout). The node checkout path itself moves into a single source of truth: INFINITO_NODE_SRC_DIR in default.env, consumed by the bootstrap/copy scripts, the swarm-playwright target, and the swarm inventory extras.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 17:30:36 +02:00

32 lines
1.0 KiB
Bash

#!/usr/bin/env bash
# E2E orchestrator for svc-runner.
# Validates env and the runner binary, then delegates to:
# local.sh — container health, runner process, DooD
# external.sh — GitHub registration, smoke dispatch
# Variables sourced from test.env.j2 by test-e2e-cli. RUNNER_API_TOKEN from env only.
set -euo pipefail
: "${DOCKER_IN_CONTAINER:?}"
: "${RUNNER_COUNT:?}"
: "${RUNNER_GIT_REF:?}"
: "${RUNNER_GITHUB_OWNER:?}"
: "${RUNNER_GITHUB_REPO:?}"
: "${RUNNER_INSTALL_DIR:?}"
: "${RUNNER_PROJECT_PREFIX:?}"
: "${RUNNER_SRC_DIR:?}"
: "${RUNNER_USER:?}"
echo "OK: env vars verified (RUNNER_COUNT=${RUNNER_COUNT}, RUNNER_PROJECT_PREFIX=${RUNNER_PROJECT_PREFIX}, RUNNER_GIT_REF=${RUNNER_GIT_REF})"
if [[ ! -f "${RUNNER_INSTALL_DIR}/1/run.sh" ]]; then
echo "FAIL: runner binary absent at ${RUNNER_INSTALL_DIR}/1/run.sh"
exit 1
fi
echo "OK: runner binary present at ${RUNNER_INSTALL_DIR}/1/run.sh"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
bash "${DIR}/local.sh"
bash "${DIR}/external.sh"
echo "ALL CHECKS PASSED"