Validate export delivery in the controlled integration window
Why: Finish Dev #488 with delivered Frontend and RDM objects, explicit audit grants in private browser fixtures, and owned process cleanup. Evidence: Tool-imported SELF precheck, final sync, make test, and real-browser runs retain failures and passes; latest isolated runtime completed seven browser cases. Final exact-head GATE and independent parent Review follow. Impact: Preserves other main components and existing CI jobs while the one final candidate is fixed for formal checks. Refs: Dev PR #488; Frontend PR #73; RDM PR #301; queue Issue #518
This commit is contained in:
File diff suppressed because one or more lines are too long
+21
-12
@@ -48,7 +48,8 @@ die() { printf '\033[31m[e2e][FAIL]\033[0m %s\n' "$*" >&2; exit 1; }
|
||||
command -v go >/dev/null || die "go not found"
|
||||
command -v node >/dev/null || die "node not found"
|
||||
command -v curl >/dev/null || die "curl not found"
|
||||
[ -d "$RDM_REPO/.git" ] || die "RDM repo not found at $RDM_REPO (set RDM_REPO)"
|
||||
[ "$(git -C "$RDM_REPO" rev-parse --is-inside-work-tree 2>/dev/null)" = true ] \
|
||||
|| die "RDM repo not found at $RDM_REPO (set RDM_REPO)"
|
||||
|
||||
for p in "$API_PORT" "$UI_PORT"; do
|
||||
if timeout 2 bash -c "echo > /dev/tcp/127.0.0.1/$p" 2>/dev/null; then
|
||||
@@ -75,12 +76,12 @@ PIN_SHA_WANT=$(git -C "$RDM_REPO" ls-tree "$RDM_SHA" pins/agent-system-backend |
|
||||
mkdir -p "$RDM_WT/pins"
|
||||
tar -C "$RDM_REPO/pins" --exclude=.git -cf - agent-system-backend | tar -C "$RDM_WT/pins" -xf -
|
||||
cleanup() {
|
||||
[ -n "${API_PID:-}" ] && kill "$API_PID" 2>/dev/null || true
|
||||
# npx→node 的进程树用单 PID 杀不净:按命令行匹配兜底(本脚本专用端口)。
|
||||
[ -n "${UI_PID:-}" ] && kill "$UI_PID" 2>/dev/null || true
|
||||
pkill -f "vite preview --port $UI_PORT" 2>/dev/null || true
|
||||
pkill -f "agent-system-rdm -data.*e2e" 2>/dev/null || true
|
||||
pkill -f "agent-system serve .*$API_PORT" 2>/dev/null || true
|
||||
[ -n "${API_PID:-}" ] && { kill "$API_PID" 2>/dev/null || true; wait "$API_PID" 2>/dev/null || true; }
|
||||
# Preview runs directly as one owned Vite process. Verify its command before
|
||||
# signaling: a recycled PID must never stop another worktree's process.
|
||||
if [ -n "${UI_PID:-}" ] && ps -p "$UI_PID" -o args= 2>/dev/null | rg -Fq -- "vite preview --port $UI_PORT"; then
|
||||
kill "$UI_PID" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
(cd "$RDM_WT" && go build -o "$OUT/agent-system-rdm" .) || die "rdm build failed"
|
||||
@@ -163,6 +164,13 @@ PID_MAIN=$(cmd rdm.project.create "{\"name\":\"$PROJ_MAIN\"}" | python3 -c 'impo
|
||||
PID_ISO=$(cmd rdm.project.create "{\"name\":\"$PROJ_ISO\"}" | python3 -c 'import json,sys; print(json.load(sys.stdin)["projectId"])')
|
||||
log "seed: projects main=$PID_MAIN iso=$PID_ISO"
|
||||
|
||||
# I1 requires a current business grant even for a project creator or system
|
||||
# administrator. Both projects are ordinary test fixtures in this private data root.
|
||||
log "seed: grant explicit audit.read for the fixture owner"
|
||||
cmd rdm.perm.cap '{"action":"audit.read","allow":true}' >/dev/null
|
||||
cmd rdm.perm.set "{\"projectId\":\"$PID_MAIN\",\"member\":\"$OWNER\",\"action\":\"audit.read\",\"allow\":true}" >/dev/null
|
||||
cmd rdm.perm.set "{\"projectId\":\"$PID_ISO\",\"member\":\"$OWNER\",\"action\":\"audit.read\",\"allow\":true}" >/dev/null
|
||||
|
||||
log "seed: import requirement ledger into $PID_MAIN"
|
||||
cmd rdm.reqs.import "{\"projectId\":\"$PID_MAIN\",\"items\":$(
|
||||
python3 - <<'PY'
|
||||
@@ -215,11 +223,12 @@ if [ "$SEED_ONLY" = 1 ]; then
|
||||
fi
|
||||
|
||||
log "start vite preview at http://127.0.0.1:$UI_PORT"
|
||||
(cd "$DEV_ROOT/modules/frontend" && \
|
||||
PLAYWRIGHT_API_TARGET="$API_BASE" npx vite preview --port "$UI_PORT" --strictPort \
|
||||
>"$OUT/preview.log" 2>&1 &
|
||||
echo $! > "$OUT/preview.pid")
|
||||
UI_PID=$(cat "$OUT/preview.pid")
|
||||
(
|
||||
cd "$DEV_ROOT/modules/frontend"
|
||||
export PLAYWRIGHT_API_TARGET="$API_BASE"
|
||||
exec ./node_modules/.bin/vite preview --port "$UI_PORT" --strictPort
|
||||
) >"$OUT/preview.log" 2>&1 &
|
||||
UI_PID=$!
|
||||
for i in $(seq 1 40); do
|
||||
curl -sf -o /dev/null "http://127.0.0.1:$UI_PORT/" && break
|
||||
sleep 0.25
|
||||
|
||||
Reference in New Issue
Block a user