Skip to content

feat(platform): save a run as a test - #4818

Merged
yannickmonney merged 2 commits into
mainfrom
feat/automation-save-as-test
Oct 11, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
feat/automation-save-as-test

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What

Save a run as a test (P5 S10c3). Builds on #4815 and #4816.

  • Save the run as a test dialog. It uses the shared builder (testFromRun, simulationCandidates, expectChoices, defaultExpect), which was unused until now:
    • Name: by default "From the run of {when}", in the reader's language.
    • The test expects, by how the run ended:
      • a succeeded run: "It returns this output" by default, or "Its output includes this";
      • a failed run: "It succeeds" by default ("the test fails until that is fixed"), or "It fails at {node}";
      • "Nothing yet" in both cases.
    • Simulate with this run's data: the steps that called out, on by default. Code steps stay off ("Your code is what the test checks."), as do stand-ins too large to keep or steps not in this version.
    • Also expect the same actions.
    • What to know before saving: values withheld as secrets (how many), a live run's calls that answer otherwise in a test, parts too large, stand-ins that couldn't be kept. Also where the test goes and who can read it.
  • Add test puts the test in the draft and opens it on Setup. Saving the draft keeps it.
  • Entry points:
    • Add test › From a run › the five newest runs.
    • The run page's menu Save as test… (for authors). It opens the editor with ?saveRun=<id>; the editor reads the run, opens the dialog and drops the parameter.
    • The Unsaved test strip's Save as test, for a try of the draft.
  • The test is made in the browser: the run detail already carries the raw input, output, trace, checkpoints and effects, and the builder withholds what looks like a secret itself. So no server route is added, and the builder's doc comment now names these doors.
  • A row menu in the runs table is left for the polish slice; the table has no row actions yet.

Docs and manual

  • The testing page (EN/DE/FR) gains "Save a run as a test", with a new screenshot (automation-save-as-test: the seeded live run of Answer launch questions, its search simulated). From a run is named in the add menu paragraph.
  • Manual: AUTO-F177, and a reference row for the automated coverage.

Verification (local)

  • Platform tsc; oxlint on the changed files and the automations, routes and engine trees.

  • The whole server and PII projects: 87,724 of 87,724.

  • The whole platform UI suite: 7,560 of 7,560. Automations browser tests: 95 of 95.

  • @tale/ui unit (4,095) and browser (223), services/docs (709) and services/ui-docs (106) tests, i18n (616), lint:links, lint:manual, knip.

  • New tests:

    • a stored run's detail and a try read for the builder (save-as-test.test.ts);
    • the dialog: the defaults for a succeeded run and its model stand-in, code off with why, the other-version line, the name, a failed run's choices and help, a withheld secret said (save-as-test-dialog.test.tsx);
    • the editor: From a run into the draft, a route's saveRun opened once and forgotten, and the try strip's Save as test;
    • the run page's menu item, for authors only (run-actions.test.tsx).
  • Live in Chromium on a local stack (Order discounts), no console errors:

    • Add test › From a run offered the stored run. The dialog offered the four expectations, with Discount and Total listed as code the test checks.
    • The added test, "From the run of Oct 11, 2026, 7:21 PM", had the run's input (quantity 50) and expected its output (gross 500, total 500, discount 0).
    • The run page's Save as test… opened the editor (address back to ?panel=tests) with the dialog.

A dialog makes a test from a run with the shared builder: a name, what it expects by how the run ended, the steps that answer as they did in the run (code steps stay off), whether it expects the same actions, and what to know first (values withheld as secrets, a live run's calls, sizes). The test joins the draft and opens on Setup. It opens from Add test's From a run, from a run page's Save as test (through the editor's saveRun parameter) and from a try's strip; the test is made in the browser from the run's detail.
The testing page explains where a run becomes a test and what the dialog asks, with a screenshot of the seeded live run of Answer launch questions saved as a test.
@yannickmonney
yannickmonney merged commit e3e4bac into main Oct 11, 2026
@yannickmonney
yannickmonney deleted the feat/automation-save-as-test branch October 11, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant