diag: log rejected intents server-side; preserve e2e artifacts on CI failure

The boss-attack e2e test keeps reporting bossHp completely unchanged
(1200, not just short of the timeout) on the CI runner, across two
separate runs, while it passes reliably in ~11s locally. Couldn't get
more signal from the runner itself: test-results/ (screenshots,
trace.zip, error-context.md) was never uploaded anywhere by the
workflow, so it's gone the moment the ephemeral job container is torn
down -- there was nothing left to retrieve.

Two changes to actually get signal on the next failure instead of
guessing blind:

- internal/transport/http.go: a rejected intent (e.g. "boss out of
  reach", "attack cooldown") already gets stored on c.Message for the
  client to show as a notice, but was never logged server-side. Now it
  is, via slog.Warn, so it shows up directly in the [WebServer] console
  output already captured in the job log -- no artifact retrieval
  needed.
- .gitea/workflows/build.yaml: upload test-results/ as a build artifact
  when the verify job fails, so trace.zip etc. survive past the job
  container for cases where the console log alone isn't enough.

Verified server still builds/vets clean and the full local e2e suite
(all 7 tests across game.spec.ts + portal.spec.ts, matching CI's count)
still passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-06 11:57:36 -04:00
co-authored by Claude Sonnet 5
parent c5b8361a44
commit 74ff146717
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -36,6 +36,14 @@ jobs:
run: go vet ./... run: go vet ./...
- run: npx playwright install --with-deps chromium - run: npx playwright install --with-deps chromium
- run: npm run test:e2e - run: npm run test:e2e
- name: Upload Playwright results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: test-results/
retention-days: 7
if-no-files-found: ignore
- uses: azure/setup-helm@v4.3.0 - uses: azure/setup-helm@v4.3.0
- run: | - run: |
helm lint deploy/chart helm lint deploy/chart
+2
View File
@@ -5,6 +5,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"io" "io"
"log/slog"
"net" "net"
"net/http" "net/http"
"os" "os"
@@ -433,6 +434,7 @@ func (h *HTTP) socket(w http.ResponseWriter, r *http.Request) {
} }
if err = h.s.world.Intent(id, intent); err != nil { if err = h.s.world.Intent(id, intent); err != nil {
c.Message = err.Error() c.Message = err.Error()
slog.Warn("intent rejected", "character", id, "op", intent.Op, "target", intent.Target, "error", err)
} }
h.s.mu.Unlock() h.s.mu.Unlock()
} }