Skill Tracer
Skills › gstack › gstack › test-free.sh

test-free.sh

36 lines · scripts/ubicloud/test-free.sh at 3f79d81

1#!/usr/bin/env bash
2# bun run test:ubicloud [test:free args] — run the free suite on an ephemeral
3# Ubicloud VM (standard-16 unless UBI_SIZE says otherwise) with the required CI
4# lane's environment. Shard logs land in .context/ubicloud/<timestamp>/.
5# With --record-durations, the refreshed scripts/free-test-durations.json is
6# copied back into this checkout.
7#
8# --diagnostic [ship-measure free args]: /ship's free-suite flake measurement
9# (scripts/ship-measure.ts free) on one VM, rerunning one shard's exact file
10# list N times in parallel with the flaky retry OFF, so a retry never inflates
11# the measured rate. Its captures land in .context/ubicloud/<timestamp>/.
12set -euo pipefail
14here=$(cd "$(dirname "$0")" && pwd)
15root=$(cd "$here/../.." && pwd)
16logs="$root/.context/ubicloud/$(date +%Y%m%d-%H%M%S)"
18if [ "${1:-}" = --diagnostic ]; then
19 shift
20 exec "$here/ubi-runner.sh" run --src "$root" --setup "$here/setup-free-suite.sh" \
21 --env GSTACK_EXPECT_BINARIES=1 --env GSTACK_FREE_RETRY_FLAKY=0 \
22 --pull "work/$(basename "$root")/.context/ship-measure:$logs" \
23 -- "xvfb-run -a bun --no-env-file --config=/dev/null run scripts/ship-measure.ts free --backend local $*"
24fi
26args=(--src "$root" --setup "$here/setup-free-suite.sh"
27 --env GSTACK_EXPECT_BINARIES=1 --env GSTACK_FREE_RETRY_FLAKY=1
28 --env GSTACK_FLAKE_LEDGER=/tmp/gstack-free-test-flake-ledger.jsonl
29 --pull "/tmp/gstack-free-test-*:$logs"
30 --pull "work/$(basename "$root")/.context/free-test-logs:$logs")
31[ -z "${GSTACK_FREE_JOBS:-}" ] || args+=(--env "GSTACK_FREE_JOBS=$GSTACK_FREE_JOBS")
32for arg in "$@"; do
33 [ "$arg" != --record-durations ] || args+=(--pull "work/$(basename "$root")/scripts/free-test-durations.json:$root/scripts")
34done
36"$here/ubi-runner.sh" run "${args[@]}" -- "xvfb-run -a bun run test:free $*"