forked from akai/readest
d06e1849cc
* feat(rsvp): add persistent context, display settings, and layout improvements, closes #3333 Add always-visible collapsible context panel, font size adjustment, ORP color selection, and stable context window that only rebuilds on scroll. Refactor speed controls into playback row with collapsible settings behind a gear icon. Translate new i18n keys across 29 locales. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(selfhost): update docker db schema to match FileRecords (#3527) In #2636, FileRecord was defined to have updated_at field which is used when it is accessed from the database. But the local dev setup is missing this field. This diff adds an updated_at column to match the expectation * chore(ci): cache system dependency and rustc outputs in ci * chore(ci): lint script changed from tsc to tsgo --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Azeem Bande-Ali <me@azeemba.com>
72 lines
2.1 KiB
Bash
Executable File
72 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Starts a Next.js dev server, launches the Tauri app with webdriver
|
|
# (no file watcher, no built-in dev server), waits for the WebDriver
|
|
# server on port 4445, runs tests, then tears down everything cleanly.
|
|
#
|
|
set -euo pipefail
|
|
|
|
DEV_PORT=3000
|
|
WEBDRIVER_PORT=4445
|
|
POLL_INTERVAL=3
|
|
TIMEOUT=300
|
|
|
|
cleanup() {
|
|
if [[ -n "${TAURI_PID:-}" ]]; then
|
|
pkill -P "$TAURI_PID" 2>/dev/null || true
|
|
kill "$TAURI_PID" 2>/dev/null || true
|
|
wait "$TAURI_PID" 2>/dev/null || true
|
|
fi
|
|
if [[ -n "${DEV_PID:-}" ]]; then
|
|
pkill -P "$DEV_PID" 2>/dev/null || true
|
|
kill "$DEV_PID" 2>/dev/null || true
|
|
wait "$DEV_PID" 2>/dev/null || true
|
|
fi
|
|
lsof -ti :"$WEBDRIVER_PORT" 2>/dev/null | xargs kill 2>/dev/null || true
|
|
lsof -ti :"$DEV_PORT" 2>/dev/null | xargs kill 2>/dev/null || true
|
|
}
|
|
|
|
trap cleanup EXIT INT TERM
|
|
|
|
echo "Starting Next.js dev server..."
|
|
dotenv -e .env.tauri -- next dev &
|
|
DEV_PID=$!
|
|
|
|
echo "Waiting for dev server on port $DEV_PORT..."
|
|
elapsed=0
|
|
while ! curl -sf "http://localhost:${DEV_PORT}" >/dev/null 2>&1; do
|
|
if ! kill -0 "$DEV_PID" 2>/dev/null; then
|
|
echo "ERROR: Dev server exited unexpectedly."
|
|
exit 1
|
|
fi
|
|
if (( elapsed >= TIMEOUT )); then
|
|
echo "ERROR: Timed out waiting for dev server on port $DEV_PORT."
|
|
exit 1
|
|
fi
|
|
sleep "$POLL_INTERVAL"
|
|
(( elapsed += POLL_INTERVAL ))
|
|
done
|
|
|
|
echo "Starting Tauri app with webdriver (no-watch, skip beforeDevCommand)..."
|
|
dotenv -e .env.tauri -- tauri dev --features webdriver --no-watch \
|
|
--config '{"build":{"beforeDevCommand":""}}' &
|
|
TAURI_PID=$!
|
|
|
|
echo "Waiting for WebDriver server on port $WEBDRIVER_PORT (timeout ${TIMEOUT}s)..."
|
|
elapsed=0
|
|
while ! curl -sf "http://127.0.0.1:${WEBDRIVER_PORT}/status" >/dev/null 2>&1; do
|
|
if ! kill -0 "$TAURI_PID" 2>/dev/null; then
|
|
echo "ERROR: Tauri app exited before WebDriver became ready."
|
|
exit 1
|
|
fi
|
|
if (( elapsed >= TIMEOUT )); then
|
|
echo "ERROR: Timed out waiting for WebDriver on port $WEBDRIVER_PORT."
|
|
exit 1
|
|
fi
|
|
sleep "$POLL_INTERVAL"
|
|
(( elapsed += POLL_INTERVAL ))
|
|
done
|
|
|
|
echo "WebDriver is ready. Running Tauri tests..."
|
|
pnpm vitest --config vitest.tauri.config.mts --watch=false
|