From ea30b24cd4a72bcfe5da145e38a41002fa23dbab Mon Sep 17 00:00:00 2001 From: you Date: Sun, 29 Mar 2026 17:00:27 +0000 Subject: [PATCH] ci: use Go server instead of Node.js for E2E tests The Playwright E2E tests were starting `node server.js` (the deprecated JS server) instead of the Go server, meaning E2E tests weren't testing the production backend at all. Changes: - Add Go 1.22 setup and build steps to the node-test job - Build the Go server binary before E2E tests run - Replace `node server.js` with `./corescope-server` in both the instrumented (coverage) and quick (no-coverage) E2E server starts - Use `-port 13581` and `-public` flags to configure the Go server - For coverage runs, serve from `public-instrumented/` directory The Go server serves the same static files and exposes compatible /api/* routes (stats, packets, health, perf) that the E2E tests hit. --- .github/workflows/deploy.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 61d6ab3..e8b4315 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -184,6 +184,20 @@ jobs: with: node-version: '22' + - name: Set up Go 1.22 + if: steps.docs-check.outputs.docs_only != 'true' + uses: actions/setup-go@v6 + with: + go-version: '1.22' + cache-dependency-path: cmd/server/go.sum + + - name: Build Go server for E2E tests + if: steps.docs-check.outputs.docs_only != 'true' + run: | + cd cmd/server + go build -o ../../corescope-server . + echo "Go server built successfully" + - name: Install npm dependencies if: steps.docs-check.outputs.docs_only != 'true' run: npm ci --production=false @@ -244,7 +258,7 @@ jobs: # Kill any stale server on 13581 fuser -k 13581/tcp 2>/dev/null || true sleep 2 - COVERAGE=1 PORT=13581 node server.js & + ./corescope-server -port 13581 -public public-instrumented & echo $! > .server.pid echo "Server PID: $(cat .server.pid)" # Health-check poll loop (up to 30s) @@ -256,7 +270,7 @@ jobs: if [ "$i" -eq 30 ]; then echo "Server failed to start within 30s" echo "Last few lines from server logs:" - ps aux | grep "PORT=13581" || echo "No server process found" + ps aux | grep "corescope-server" || echo "No server process found" exit 1 fi sleep 1 @@ -312,7 +326,7 @@ jobs: if: steps.docs-check.outputs.docs_only != 'true' && steps.changes.outputs.frontend == 'false' run: | fuser -k 13581/tcp 2>/dev/null || true - PORT=13581 node server.js & + ./corescope-server -port 13581 -public public & SERVER_PID=$! # Wait for server to be ready (up to 15s) for i in $(seq 1 15); do