Files
computer-playbook/scripts/tests/workspace/00_orchestrator.sh
T
kevinveenbirkenbachandClaude Opus 5 3781c30235 fix(env): write the cache-stack declaration from a handler, not the registry
48845db97 made three capability decisions declarable and named them INFINITO_*, which put them under setdefault: the live environment wins and the value is written back. Makefile exports BASH_ENV, so .env is re-exported into every make recipe, and scripts/tests/code/run.sh reaches dotenv through 'make setup' on every test run. A declaration made for one run therefore became a machine fact on first regeneration and stayed one - that is what made the workspace failure intermittent rather than reproducible, and why fedora died on 11 assertions where debian passed the same code.

A dedicated handler writing through eb.set recomputes the value every time and discards whatever the environment held, so the key stays registered in default.env and visible to the lints while remaining structurally unpinnable. running_on/github.py already worked this way; the distinction now has a name in utils/env/README.md. The exporting shell still steers its own run, because load.sh preserves non-empty caller values.

The other two declarations are deleted rather than moved. image_mirror_enabled and docker_root_ephemeral both derive from runs_on_github(), and the orchestrator does not unset INFINITO_RUNNING_ON_GITHUB, so inside the workspace they were already true and the declarations restated a value that held anyway. Measured across all four runtime contexts: only the workspace row changes, and only for the cache.

Verified by reversing the probe: 'INFINITO_CACHE_STACK=false make dotenv' writes .env=true, where the registry path wrote the exported value back.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 23:24:15 +02:00

45 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Orchestrates the local Infinito.Nexus workspace test suite.
# Serves as a reference for how to deploy and debug applications locally.
# Chdirs to the repository root because pkgmgr images may invoke it elsewhere.
#
# Env:
# INFINITO_WORKSPACE_TRACKS space-separated track directories to run, in the
# order given (e.g. "base swarm"). Empty runs
# base, compose and swarm.
set -euo pipefail
unset GITHUB_ACTIONS
unset ACT
unset CI
export INFINITO_CACHE_STACK=true
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=scripts/tests/workspace/utils/common.sh
source "${SCRIPT_DIR}/utils/common.sh"
cd "${REPO_ROOT}"
ran=0
for track in ${INFINITO_WORKSPACE_TRACKS:?set it or refresh a stale .env with \`make dotenv\`}; do
track_dir="${SCRIPT_DIR}/${track}"
if [ ! -d "${track_dir}" ]; then
echo "FAILURE: no such workspace track: '${track}'" >&2
exit 1
fi
for step in "${track_dir}"/[0-9][0-9]_*.sh; do
load_repo_env
ensure_git_safe_directory
echo "============================================================"
echo ">>> ${track}/$(basename "${step}")"
echo "============================================================"
bash "${step}"
ran=$((ran + 1))
done
done
if [ "${ran}" -eq 0 ]; then
echo "FAILURE: INFINITO_WORKSPACE_TRACKS='${INFINITO_WORKSPACE_TRACKS:-}' ran no step." >&2
exit 1
fi