Skip to content

ci: timer-bound app scenarios run on main, nightly and on labeled PRs instead of gating every PR - #1008

Merged
davideast merged 2 commits into
mainfrom
ci/slow-app-scenarios
Oct 16, 2026
Merged

davideast merged 2 commits into
mainfrom
ci/slow-app-scenarios

Conversation

@davideast

Copy link
Copy Markdown
Owner

App scenarios that wait on real timeouts now mark themselves slow: Build & Test skips them, and a new Slow app scenarios workflow runs them on main, nightly, on demand, and on pull requests labeled ci-slow-scenarios.

// test/apps/host-closes-silent-page/scenario.ts
/** Waits out a 40s liveness window and a heartbeat past it, so pull requests skip it (test/apps/selection.ts). */
export const slow = true;

export default scenario(async (app) => { /* unchanged */ });
$ bun test/apps/run.ts --build --skip-slow
▸ running 12 apps, 3 at a time
...
✓ 12 apps passed (196.1s); skipped 1 slow app (host-closes-silent-page)

$ bun test/apps/run.ts --only-slow
▸ running 1 app, 3 at a time
✓ host-closes-silent-page (81.3s)

$ bun test/apps/run.ts host-closes-silent-page   # a named app runs either way

Build & Test skips slow apps on every event; the slow workflow runs only them

The app-scenarios job runs bun test/apps/run.ts --packages dist/packages --skip-slow on pull requests and on main alike, so no slow app runs twice. Its selection by scripts/ci/plan.ts does not change.

.github/workflows/slow-scenarios.yml reuses that job's steps (Bun and npm caches, restore-dist, Playwright Chromium, pack-packages.sh --skip-build, log upload on failure) and runs --only-slow. Triggers:

Trigger When
push to main
schedule 47 9 * * *, 30 minutes after Build & Test's nightly
pull_request labeled the job runs only when the added label is ci-slow-scenarios; a push after the label does not re-run it (remove and re-add the label, or re-run)
workflow_dispatch on the chosen ref, with an optional scenario input that runs one app by name

It has permissions: contents: read, uses no secrets, and is not one of the needs of CI / required. Concurrency is one group per ref with cancel in progress; a run started by any other label gets its own group, so labeling a PR ci-packaging does not cancel a slow run in progress.

An empty selection exits 2. If the last slow = true marker is removed, the slow workflow fails instead of passing with nothing driven.

AGENTS.md rule 7 now says a timer-bound scenario is marked slow, where it runs, and that a PR changing what one covers gets the ci-slow-scenarios label and names the run.

Risk

  • A pull request that breaks what host-closes-silent-page covers (peer liveness in packages/cli/src/serve/) no longer fails CI / required. It fails on the next push to main or the nightly, unless the PR carries the label. The AGENTS.md rule is the guard.
  • The runner now imports every scenario.ts before installing anything when --skip-slow or --only-slow is passed, so a scenario's top level must import only the driver, Playwright, and node built-ins. Every scenario does today; test/apps/README.md says so.
  • workflow_dispatch cannot be exercised until this file is on main.

Integration test: the Slow app scenarios run this PR starts when it is labeled ci-slow-scenarios, and the app-scenarios job of this PR's Build & Test run, which skips the slow app. The deletion guard has nothing to acknowledge: no test file is deleted and no job is removed.

Implementation notes
  • test/apps/selection.ts holds the option parsing (moved from run.ts) and selectApps, so the selection is testable without running run.ts's top-level main(). test/apps/selection.test.ts covers skip, only, include, named apps under each filter, the summary clause, the flag conflict, and the real marker on host-closes-silent-page. The app-scenarios job runs it before the scenarios.
  • --skip-slow and --only-slow together are refused.
  • scripts/publish-alpha.sh still runs every app, slow ones included, before publishing.
  • Local: bun test/apps/run.ts --build --skip-slow passed 12 apps in 196.1s; --only-slow passed host-closes-silent-page in 81.3s (99.8s with packing). actionlint 1.7.7 reports nothing for build.yml and slow-scenarios.yml. bun test scripts/ci/workflow-paths.test.ts scripts/ci/plan.test.ts scripts/ci/deletion-guard.test.ts passes.

… instead of gating every PR

A scenario that waits on real timeouts exports `slow = true` from its
scenario.ts. test/apps/run.ts gains --skip-slow and --only-slow; an app
named on the command line runs either way, and the run summary names the
slow apps it skipped. An empty selection exits 2, so a removed marker
fails the slow run instead of passing it with nothing driven.

host-closes-silent-page waits out a 40s liveness window and a heartbeat
past it, about 80s of the app-scenarios job. It is marked slow.

Build & Test's app-scenarios job now runs with --skip-slow on every
event. The new Slow app scenarios workflow runs --only-slow on the same
packed packages on pushes to main, nightly, on demand (with an optional
scenario name), and on a pull request when the ci-slow-scenarios label
is added. It is not part of CI / required.

Local: --build --skip-slow ran 12 apps in 196.1s and reported
host-closes-silent-page as skipped; --only-slow ran it alone and it
passed in 81.3s.
@davideast
davideast merged commit 2c0b84e into main Oct 16, 2026
20 checks passed
@davideast
davideast deleted the ci/slow-app-scenarios branch October 16, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-slow-scenarios Run the slow app scenarios (timer-bound) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant