test: add resumable isolated test harness
This commit is contained in:
+12
-15
@@ -1,20 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
command=${1:-}
|
||||
case "$command" in
|
||||
doctor)
|
||||
docker version >/dev/null
|
||||
docker compose version >/dev/null
|
||||
echo "Docker and Docker Compose are available."
|
||||
;;
|
||||
status)
|
||||
echo "No test run has been created; the shared harness is not implemented yet."
|
||||
;;
|
||||
*)
|
||||
echo "usage: scripts/test-env doctor|status" >&2
|
||||
echo "recover/reuse/collect/reset/purge arrive with the Phase 0 harness implementation" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
if [ -z "$command" ]; then
|
||||
echo "usage: scripts/test-env doctor|coverage|status|logs|collect|recover|reuse|stop|reset|purge [--run-id ID]" >&2
|
||||
exit 2
|
||||
fi
|
||||
shift
|
||||
|
||||
docker version >/dev/null
|
||||
docker compose version >/dev/null
|
||||
|
||||
cd "$repo_root"
|
||||
exec docker compose -f deploy/compose.yaml run --rm toolchain \
|
||||
go run ./test/harness "$command" "$@"
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
echo "integration harness is not implemented yet; use scripts/test-unit for the current Phase 0/1 scope" >&2
|
||||
exit 2
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
toolchain_image=$(docker compose -f "$repo_root/deploy/compose.yaml" images -q toolchain 2>/dev/null || true)
|
||||
if [ -z "$toolchain_image" ]; then
|
||||
toolchain_image=$(docker image inspect rvbox-dev-toolchain --format '{{.Id}}' 2>/dev/null || true)
|
||||
fi
|
||||
|
||||
cd "$repo_root"
|
||||
exec docker compose -f deploy/compose.yaml run --rm \
|
||||
-e "RVBOX_TOOLCHAIN_IMAGE=$toolchain_image" \
|
||||
toolchain go run ./test/harness integration "$@"
|
||||
|
||||
Reference in New Issue
Block a user