Something went wrong. Try again.
small gleam coding and (not yet) persistent agent daemon with a detachable cli forked from okami.mom/albedo
Something went wrong. Try again.
albedo test.sh
1.9 kB · 65 lines
Shell
at feat/nix-dev
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566#!/usr/bin/env bash# Every check that must pass before a commit.## The quick checks run first, in order. Then the daemon is compiled once and# every suite runs at the same time, each into its own log, which is printed# only if that suite fails. The e2e suites boot their daemons from that one# snapshot (ALBEDO_TEST_DAEMON) instead of through gleam, so none of them waits# on the build lock `gleam test` holds for its whole run. test/manual is opt-in# and not run here; those harnesses need a provider, a PTY, or artifacts from# an earlier benchmark run.set -euo pipefailcd "$(dirname "$0")"export ALBEDO_NO_BROWSER=1
ruff checkruff format --check priv/python test cli/internal/storage/maintenance.pyty checkgleam format --check src testtest/gleam-lint.shcargo test --quiet --release --locked --manifest-path native/render/Cargo.tomlnative/render/install.shgo -C cli vet ./...# the Python e2e suite drives the CLI through this binarygo -C cli build -o bin/albedo ./cmd/albedo
scratch="${ALBEDO_TEST_TMP:-/tmp/albedo-tests}/gate-$$"mkdir -p "$scratch"trap 'rm -rf "$scratch"' EXITALBEDO_TEST_DAEMON="$(test/snapshot-daemon.sh "$scratch/daemon")"export ALBEDO_TEST_DAEMON
names=()pids=()log() { echo "$scratch/${1//[\/ ]/-}.log"}suite() { local name="$1" shift "$@" >"$(log "$name")" 2>&1 & names+=("$name") pids+=("$!")}
suite "gleam test" gleam testfor test in test/harness/*_test.py; do suite "$test" python3 "$test"donesuite "go test" go -C cli test ./internal/... ./cmd/...# the Go e2e suite builds its own CLI and boots a hermetic daemon, so it must# never reuse a cached runsuite "go e2e" go -C cli test -count=1 ./test/e2esuite "python e2e" python3 test/e2e/run.py
failed=0for i in "${!pids[@]}"; do if wait "${pids[$i]}"; then echo "ok ${names[$i]}" else failed=1 echo "FAILED ${names[$i]}" cat "$(log "${names[$i]}")" fidoneexit "$failed"