Add a way to stop docker after e2e tests if it wasn't already running.
Build and Push Next App / quality (push) Successful in 1m19s
Build and Push Next App / build-next (push) Has been cancelled

This commit is contained in:
Gabriel Brown
2026-06-21 15:50:40 -05:00
parent fba73a92ce
commit 7ae7b61da0
3 changed files with 36 additions and 3 deletions
+2 -1
View File
@@ -70,7 +70,8 @@ SKIP_E2E=1 bun run ci:check
``` ```
`bun test:e2e` starts the isolated local stack and currently performs generic `bun test:e2e` starts the isolated local stack and currently performs generic
stack smoke checks. It skips in CI and when `SKIP_E2E=1` is set. stack smoke checks. It stops the stack afterward only when the stack was not
already running. It skips in CI and when `SKIP_E2E=1` is set.
Shared dependency versions belong in root catalogs. Edit the root catalog, run Shared dependency versions belong in root catalogs. Edit the root catalog, run
`bun install`, then `bun lint:ws`; do not run `bun update` inside a workspace. `bun install`, then `bun lint:ws`; do not run `bun update` inside a workspace.
File diff suppressed because one or more lines are too long
+32
View File
@@ -6,5 +6,37 @@ if [ -n "${SKIP_E2E:-}" ]; then echo "SKIP_E2E set; skipping local e2e."; exit 0
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)" ROOT_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)"
if command -v docker >/dev/null 2>&1; then RUNTIME=docker
elif command -v podman >/dev/null 2>&1; then RUNTIME=podman
else echo "Docker or Podman is required for local e2e." >&2; exit 1; fi
container_running() {
"$RUNTIME" ps --format '{{.Names}}' | grep -qx "$1"
}
if container_running convexmonorepo-local-convex \
&& container_running convexmonorepo-local-convex-dashboard; then
SHOULD_STOP_STACK=false
else
SHOULD_STOP_STACK=true
fi
cleanup() {
if [ "$SHOULD_STOP_STACK" = true ]; then
"$RUNTIME" rm -f \
convexmonorepo-local-convex-dashboard \
convexmonorepo-local-convex \
>/dev/null 2>&1 || true
fi
}
trap cleanup EXIT
if [ "$SHOULD_STOP_STACK" = true ]; then
bash "$ROOT_DIR/scripts/db/up" bash "$ROOT_DIR/scripts/db/up"
fi
curl -fs "http://localhost:${BACKEND_PORT:-3210}/version" >/dev/null
curl -fs "http://localhost:${DASHBOARD_PORT:-6791}" >/dev/null
echo "Local-stack smoke checks passed; no seeded browser flow is configured." echo "Local-stack smoke checks passed; no seeded browser flow is configured."