mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
test(e2e): run the delegated-writes journey and fail on silent skips
The delegated-writes spec checked for the invitation form's level control right after page load, before the form had painted, found nothing and skipped every test on every run, CI included. - Give the journey its own account pair, seeded and reset in global setup, so it no longer invites the same pair as the account-sharing journey (a second live grant between two accounts is refused with 409). - Wait for the form through its data-slot and fail when the WRITE level control is missing instead of skipping. - Revoke the journey's grant in afterAll. - Keep it out of the mobile project in the config rather than through a runtime skip. Add two checks so a skip cannot hide a spec again: - e2e-conditional-skip-guard.test.ts requires every conditional test.skip/test.fixme in e2e/ to carry a reason and refuses a bare test.skip(). - scripts/check-e2e-skipped-specs.mjs reads the Playwright JSON reports of both shards in the e2e gate job and fails when a spec file skipped all of its tests across every project, apart from an allowlist with reasons.
This commit is contained in:
1 parent
1f725326b0
commit
ed05772a8e
10 files changed
+719
-68
No files matched your search
@@ -110,6 +110,17 @@ jobs:
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
|
||||
# The machine-readable report, for the skipped-spec check in the gate
|
||||
# job below. Only uploaded when the shard ran to completion, so a missing
|
||||
# artifact there means a shard that did not finish, not an empty suite.
|
||||
- name: Upload Playwright JSON report
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: playwright-json-shard-${{ matrix.shard }}
|
||||
path: playwright-json/results.json
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
# Branch protection requires a check named exactly "e2e". This job carries
|
||||
# that name and answers for both shards: it fails when any shard failed or
|
||||
# was cancelled, so a half-green matrix cannot satisfy the gate.
|
||||
@@ -125,3 +136,19 @@ jobs:
|
||||
echo "shard result: ${{ needs.shard.result }}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# A spec file that skipped every one of its tests reports green. The
|
||||
# check aggregates both shards' reports, because Playwright splits a
|
||||
# file's tests across shards; see the script's header for the allowlist.
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
sparse-checkout: scripts
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version: 22
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: playwright-json-shard-*
|
||||
path: playwright-json
|
||||
- name: No spec file skipped all of its tests
|
||||
run: node scripts/check-e2e-skipped-specs.mjs playwright-json/*/results.json
|
||||
Reference in new issue
Block a user