fix(import): подтвердить обязательные гарантии второго эпика
CI / Rust Checks (pull_request) Successful in 24m43s
CI / UI Checks (pull_request) Successful in 6s
CI / Community Image Smoke (pull_request) Successful in 9m5s
CI / Frontend E2E (pull_request) Successful in 12m43s
CI / Deploy (pull_request) Skipped

This commit is contained in:
bsodfather committed 2026-10-10 13:25:05 +03:00
1 parent 31f6f00d3b
commit ad23cd9a46
33 files changed
+3328 -18

No files matched your search

+63 -6
View File
@@ -101,6 +101,7 @@ trap cleanup EXIT
trap 'exit 130' INT TERM
cleanup
rm -f "$TMP_DIR/admin-control.request" "$TMP_DIR/admin-control.ack"
show_startup_log() {
local log_file="$1"
@@ -235,7 +236,8 @@ chmod 700 "$CRANK_STORAGE_ROOT"
(
cd "$ROOT_DIR/apps/ui"
exec node scripts/playwright-http-fixture.js >"$LOG_DIR/http-fixture.log" 2>&1
exec env CRANK_E2E_STREAM_FIXTURE_PORT="$STREAM_FIXTURE_PORT" \
node scripts/playwright-http-fixture.js >"$LOG_DIR/http-fixture.log" 2>&1
) &
echo $! > "$TMP_DIR/http-fixture.pid"
@@ -292,12 +294,27 @@ if ! (
exit 1
fi
# Launch the built executable directly so the test lifecycle controls the
# actual server PID, rather than a Cargo wrapper. This control exists only in
# the local Playwright harness and adds no application endpoint/configuration.
(
cd "$ROOT_DIR"
exec env -u CRANK_MCP_BIND -u CRANK_MCP_REFRESH_MS CRANK_DEMO_SEED=true \
cargo run -p admin-api --bin admin-api >>"$LOG_DIR/admin-api.log" 2>&1
) &
echo $! > "$TMP_DIR/admin-api.pid"
cargo build -p admin-api --bin admin-api --example e2e_storage_counts >>"$LOG_DIR/admin-api.log" 2>&1
)
ADMIN_BINARY="${CARGO_TARGET_DIR:-$ROOT_DIR/target}/debug/admin-api"
if [[ "$ADMIN_BINARY" != /* ]]; then
ADMIN_BINARY="$ROOT_DIR/$ADMIN_BINARY"
fi
STORAGE_COUNTS_BINARY="$(dirname "$ADMIN_BINARY")/examples/e2e_storage_counts"
start_admin() {
(
cd "$ROOT_DIR"
exec env -u CRANK_MCP_BIND -u CRANK_MCP_REFRESH_MS CRANK_DEMO_SEED=true \
"$ADMIN_BINARY" >>"$LOG_DIR/admin-api.log" 2>&1
) &
echo $! > "$TMP_DIR/admin-api.pid"
}
start_admin
wait_for_http \
"admin-api" \
@@ -322,7 +339,9 @@ wait_for_http \
(
cd "$ROOT_DIR/apps/ui"
exec node scripts/playwright-ui-server.js >"$LOG_DIR/ui-server.log" 2>&1
exec env CRANK_E2E_UI_PORT="$UI_PORT" CRANK_E2E_ADMIN_PORT="$ADMIN_PORT" \
CRANK_E2E_MCP_PORT="$MCP_PORT" \
node scripts/playwright-ui-server.js >"$LOG_DIR/ui-server.log" 2>&1
) &
echo $! > "$TMP_DIR/ui-server.pid"
@@ -335,5 +354,43 @@ wait_for_http \
echo "Crank UI e2e stack is ready on http://127.0.0.1:$UI_PORT"
while true; do
if [[ -f "$TMP_DIR/admin-control.request" ]]; then
command=""
read -r command < "$TMP_DIR/admin-control.request" || true
rm -f "$TMP_DIR/admin-control.request"
case "$command" in
stop)
if [[ -f "$TMP_DIR/admin-api.pid" ]]; then
admin_pid="$(cat "$TMP_DIR/admin-api.pid")"
kill "$admin_pid" 2>/dev/null || true
wait "$admin_pid" || true
rm -f "$TMP_DIR/admin-api.pid"
fi
;;
start)
if [[ ! -f "$TMP_DIR/admin-api.pid" ]] || \
! kill -0 "$(cat "$TMP_DIR/admin-api.pid")" 2>/dev/null; then
start_admin
fi
wait_for_http "restarted admin-api" "http://127.0.0.1:$ADMIN_PORT/health" \
"$TMP_DIR/admin-api.pid" "$LOG_DIR/admin-api.log" || exit 1
;;
counts\ *)
workspace="${command#counts }"
if [[ ! "$workspace" =~ ^[a-zA-Z0-9_-]{1,128}$ ]]; then
echo "Invalid local storage observation scope" >&2
exit 1
fi
"$STORAGE_COUNTS_BINARY" "$workspace" > "$TMP_DIR/storage-counts.json.tmp"
mv "$TMP_DIR/storage-counts.json.tmp" "$TMP_DIR/storage-counts.json"
;;
*)
echo "Unknown local Admin API test control command" >&2
exit 1
;;
esac
printf '%s\n' "$command" > "$TMP_DIR/admin-control.ack.tmp"
mv "$TMP_DIR/admin-control.ack.tmp" "$TMP_DIR/admin-control.ack"
fi
sleep 1
done