test(acceptance): reproducible Stage 8 acceptance package
Add test/acceptance/ so the customer's reviewers can re-run what the Stage 8 documents claim on an isolated stand built from this branch: - compose.acceptance.yml + stand.sh: compose project gis-acceptance (app 18080, postgres 15432, minio 19000/19001, rabbitmq mgmt 15672), POSTGIS_PLATFORM / MINIO_IMAGE knobs for arm64 and amd64 hosts. - functional.sh: the 89 test-stand checks of Приложение 7 section 5 (F01-F38, N01-N38, L02-L05, L07-L15), own prefixed test data, PostGIS/MinIO confirmation via the stand containers, full cleanup. - lp_gen.py / lp_run.sh / lp_verify.py: synthetic ЛП inputs, a run from stage 0, and an independent numpy re-implementation of every node that compares all 15 outputs pixel by pixel; read-only (GET) mode works against any stand, in row/column windows for 22219x14977 rasters. - load.sh + seed.sh: scenarios S1-S6 of Приложение 3 with hey 0.1.5 running inside the stand network; CSV/JSON summaries, criteria K1-K4. - scan.sh: govulncheck (source and binary), gosec, trivy fs/image, golangci-lint; fails on any High/Critical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
54
test/acceptance/stand.sh
Executable file
54
test/acceptance/stand.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
# Brings the isolated acceptance stand (docker compose project gis-acceptance)
|
||||
# up or down.
|
||||
#
|
||||
# test/acceptance/stand.sh up build the image from this checkout, start
|
||||
# all services, apply migrations, import the
|
||||
# 14 districts, wait for /readyz
|
||||
# test/acceptance/stand.sh down stop and remove the stand with its volumes
|
||||
# test/acceptance/stand.sh ps|logs pass-through to docker compose
|
||||
#
|
||||
# Environment: MINIO_IMAGE, POSTGIS_PLATFORM, APP_IMAGE, HTTP_MAX_UPLOAD_BYTES,
|
||||
# LP_MAX_WORKERS, LP_MAX_NODES (see compose.acceptance.yml).
|
||||
set -euo pipefail
|
||||
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
ROOT="$(cd "$HERE/../.." && pwd)"
|
||||
PROJECT=gis-acceptance
|
||||
compose() {
|
||||
docker compose -p "$PROJECT" -f "$ROOT/deployments/docker-compose.yml" -f "$HERE/compose.acceptance.yml" "$@"
|
||||
}
|
||||
|
||||
cmd="${1:-up}"
|
||||
shift || true
|
||||
case "$cmd" in
|
||||
up)
|
||||
echo "== build application image from $(git -C "$ROOT" rev-parse --short HEAD 2>/dev/null || echo 'this checkout')"
|
||||
compose build app worker
|
||||
echo "== start infrastructure ($PROJECT)"
|
||||
compose up -d --wait postgres minio rabbitmq
|
||||
echo "== migrate up"
|
||||
compose run --rm --no-deps app migrate up
|
||||
echo "== import districts"
|
||||
compose run --rm --no-deps app import-districts /stubs/districts.geojson
|
||||
compose up -d app worker
|
||||
echo "== wait for http://localhost:18080/readyz"
|
||||
for _ in $(seq 1 60); do
|
||||
if curl -fsS http://localhost:18080/readyz >/dev/null 2>&1; then
|
||||
curl -sS http://localhost:18080/readyz; echo
|
||||
compose ps --format 'table {{.Service}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}'
|
||||
exit 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "stand did not become ready" >&2
|
||||
compose logs --tail 50 app worker >&2
|
||||
exit 1
|
||||
;;
|
||||
down)
|
||||
compose down -v --remove-orphans
|
||||
;;
|
||||
*)
|
||||
compose "$cmd" "$@"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user