Repository navigation
[local-test-e2e-cover-scheduled-workspace-autom] test(e2e): cover scheduled workspace automations end to end - #375
Conversation
…(e2e): cover scheduled workspace automations end to end
- Correct the open_pr = true coverage claim: the local bare remote has no detectable code-host platform, so PR creation never succeeds there. Assert pr_url is null and reword the test comments, README, and coverage matrix to say branch/push policy, leaving PR creation to the code-host suites. - Add a fixture variant whose workspace worker_task_args omit --create-pr, proving an automation's own open_pr = true opt-in still adds --create-pr and pushes a branch. - Record DEVINTERN_AUTOMATION_ID in the fake agent invocation log and assert one implement/no-change invocation per automation, instead of relying on global mode counts that another automation could satisfy.
Artifacts & verificationRun: 51 · Commit: Change explanationProduced by Why this change is needed The task states that scheduled What changed This is a test-and-documentation change under
Validation actually performed Observed in the pipeline evidence:
No additional validation was run while writing this explanation. Material risks
Where reviewers should focus
Suggested checks (not performed here)
Visual explanationProduced by Show artifactSummaryThis change adds end-to-end coverage for scheduled workspace Evidence
Merge DangerThis is reversible without production impact: every changed file is under The shared helper changes do affect existing e2e suites: The concrete shipping risk is e2e timing, not product behavior: the first test ran at 171.6s against a 180s timeout, and hot reload depends on the Verification reportProduced by Show artifactFurther artifacts omitted because they exceed the comment preview budget. |
Why
Task local-test-e2e-cover-scheduled-workspace-autom: test(e2e): cover scheduled workspace automations end to end
Scheduled workspace
[[automations]]had no end-to-end coverage. The scheduler, occurrence materialization,open_prpolicy,allow_no_changes, run attribution, and live config reconciliation were only covered by unit tests, so regressions could silently stop PR creation or mutate repositories for jobs meant to publish nothing.What changed
automationslist plusappendAutomation()topackages/e2e/helpers/worker.ts. The generatedworkspace.tomlgains[[automations]]tables only when requested, so the default fixture is unchanged.waitForAutomationRun().packages/e2e/helpers/fake-agent.tsso prompts containingE2E_NO_CHANGEselect the existing no-change path whileE2E_AGENT_MODEstill overrides.packages/e2e/tests/local/worker-automations.test.ts, which starts one real worker daemon against a local bare remote and four same-minute automatons:auto-pr-on: branch pushed, exactly one commit, onlysrc/greeting.tschanged.auto-pr-off: agent ran and the run succeeded, but--no-gitsuppressed publishing despite workspace--create-pr.noop-allowed: succeeded with--allow-no-changesand no pushed commit.noop-blocked: failed withImplementation was not committed.runs.origin = "scheduled",automation_id, occurrence files, schedule rows, no unconfigured runs, and a live daemon.workspace.tomlreload and asserted its next scheduled run.packages/e2e/README.md,packages/e2e/docs/coverage-matrix.md(row moved todefault), and backlog item 13.Scope
Included: scheduled
[[automations]]scheduling, no-op semantics, PR policy, attribution, occurrence files, and hot reload. Excluded: estimations, working windows, concurrency behavior assertions, injectedworker add, Sentry, dashboard, and any production scheduler changes.Tradeoffs
Hot reload was kept because the test completes in roughly 90–112 seconds in isolation, below the stated budget. It adds a second cron-minute wait to the test but the per-test timeout remains 180 seconds. No-op runs may still record a local branch before deciding nothing changed; assertions therefore verify nothing is committed or published, while
noop-allowedis distinguished fromnoop-blockedby run status. The existing helper default does not include--auto-review, so the policy test proves override of the present workspace--create-prrather than changing the shared default.Blast Radius
Affected files are test-only: the worker fixture, fake agent, new local test, and e2e documentation.
WorkerFixture.runRecords()now selects additional columns (origin,automation_id,started_at,finished_at); existing tests only read subsets or usetoMatchObject, and the full suite passed. The default generated workspace and all production scheduler code are unchanged.Verification
Ran from the monorepo root/package:
bun run --filter @getdevintern/code build— passed.bun test tests/local/worker-automations.test.ts— passed, 45 assertions, ~91s.bun run --filter @devintern/e2e test— passed: 136 pass, 16 skip, 4 todo, 0 fail across 156 tests in 25 files (~172s).bun run --filter @devintern/e2e typecheck— passed.bun run --filter @devintern/e2e lint— passed.bun run --filter @devintern/e2e format:check— passed./tmp/devintern-e2e-worker-*fixture paths remained after the runs.This PR was automatically created by @devintern/code