Apply the #109 review panel: fork guard, loopback dev server, real authenticated assertions.
Tests / unit (pull_request) Successful in 17s
Tests / e2e (pull_request) Failing after 1m1s

Playwright's webServer replaces the custom globalSetup. The e2e job is gated to same-repo PRs because a fork PR controls both the test files and the workflow steps while the E2E_PASSWORD secret is in the environment. The dev server is pinned to loopback, the login screen is asserted before filling, the authenticated state is proven by a token-authenticated request, the token value is never printed, the failed-login test no longer asserts a tautological exitCode, and the DevTools window is no longer mistaken for the app window.
This commit is contained in:
2026-11-03 11:04:18 +11:00
parent 348e47dbd8
commit fcbf1020e8
6 changed files with 69 additions and 82 deletions
+5 -19
View File
@@ -22,6 +22,9 @@ jobs:
run: npm run test:unit
e2e:
# A fork PR controls both the test files and these steps, so only same-repository
# PRs can be trusted with the E2E_PASSWORD secret.
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
env:
# Dedicated test account on the homeserver, not a personal one.
@@ -30,33 +33,16 @@ jobs:
# Repo secret: E2E_PASSWORD. The test fails with a clear message when it is missing.
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
steps:
# .gitmodules uses a relative URL, so the runner resolves it against origin.
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false
- name: Checkout submodules manually
run: |
set -euo pipefail
# Use the same host/scheme the runner already used for origin (not public HTTPS).
ORIGIN_URL=$(git remote get-url origin)
ORIGIN_URL=${ORIGIN_URL%/}
ORIGIN_URL=${ORIGIN_URL%.git}
BASE_URL=${ORIGIN_URL%/*}
CINNY_URL="${BASE_URL}/cinny.git"
echo "Rewriting submodule URL to ${CINNY_URL}"
git config submodule.cinny.url "${CINNY_URL}"
git submodule sync --recursive
git submodule update --init --recursive
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: |
package-lock.json
cinny/package-lock.json
- name: Install dependencies
run: npm ci