|
@@ -86,6 +86,18 @@ jobs:
|
|
|
cd $HOME/install/test-app
|
|
cd $HOME/install/test-app
|
|
|
npm run dev &
|
|
npm run dev &
|
|
|
node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests
|
|
node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests
|
|
|
|
|
+ - name: Kill dev server after smoke tests
|
|
|
|
|
+ shell: bash
|
|
|
|
|
+ run: |
|
|
|
|
|
+ # Kill everything on port 3000 so dashboard tests can start fresh
|
|
|
|
|
+ # (npm run dev spawns child processes that aren't killed by killing the parent)
|
|
|
|
|
+ if [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
|
|
|
+ # Windows: use netstat to find PID and taskkill
|
|
|
|
|
+ netstat -ano | grep ':3000' | grep 'LISTENING' | awk '{print $5}' | head -1 | xargs -r taskkill //F //PID 2>/dev/null || true
|
|
|
|
|
+ else
|
|
|
|
|
+ # Linux/macOS: use lsof
|
|
|
|
|
+ lsof -ti:3000 | xargs kill 2>/dev/null || true
|
|
|
|
|
+ fi
|
|
|
- name: Copy files (Windows)
|
|
- name: Copy files (Windows)
|
|
|
if: runner.os == 'Windows'
|
|
if: runner.os == 'Windows'
|
|
|
shell: pwsh
|
|
shell: pwsh
|
|
@@ -120,13 +132,20 @@ jobs:
|
|
|
# start the dev server in the background
|
|
# start the dev server in the background
|
|
|
npm run dev &
|
|
npm run dev &
|
|
|
DEV_PID=$!
|
|
DEV_PID=$!
|
|
|
- # Wait a moment for it to start
|
|
|
|
|
- sleep 5
|
|
|
|
|
- # Start the dashboard in the background
|
|
|
|
|
- npx vite --port 5173 &
|
|
|
|
|
|
|
+ # Wait for the dev server to be available (use /health endpoint, not root)
|
|
|
|
|
+ wait-on http://localhost:3000/health --timeout 60000
|
|
|
|
|
+ # Start the dashboard with --strictPort to fail fast if port is in use
|
|
|
|
|
+ npx vite --port 5173 --strictPort &
|
|
|
DASHBOARD_PID=$!
|
|
DASHBOARD_PID=$!
|
|
|
- # Wait a moment for it to start
|
|
|
|
|
- sleep 5
|
|
|
|
|
|
|
+ # Give Vite a moment to start or fail
|
|
|
|
|
+ sleep 3
|
|
|
|
|
+ # Check if Vite process is still running (it will exit immediately if port is in use)
|
|
|
|
|
+ if ! kill -0 $DASHBOARD_PID 2>/dev/null; then
|
|
|
|
|
+ echo "Vite failed to start - port 5173 may be in use"
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ fi
|
|
|
|
|
+ # Wait for the dashboard to be available
|
|
|
|
|
+ wait-on http://localhost:5173 --timeout 120000
|
|
|
# Run the dashboard tests
|
|
# Run the dashboard tests
|
|
|
node $GITHUB_WORKSPACE/.github/workflows/scripts/dashboard-tests.js
|
|
node $GITHUB_WORKSPACE/.github/workflows/scripts/dashboard-tests.js
|
|
|
# Clean up dashboard process
|
|
# Clean up dashboard process
|