Skip to content

feat(e2e): support test.todo - #1858

Closed
bferanmi806-sketch wants to merge 5 commits into
e2e-inc:mainfrom
bferanmi806-sketch:codex/issue-1855-test-todo
Closed

bferanmi806-sketch wants to merge 5 commits into
e2e-inc:mainfrom
bferanmi806-sketch:codex/issue-1855-test-todo

Conversation

@bferanmi806-sketch

@bferanmi806-sketch bferanmi806-sketch commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add registration-only test.todo(title).
  • Report TODOs as selected skipped results with skip.cause: "todo" and no attempts; keep report-v1 without a new status or version.
  • Keep TODO-only runs under the existing NO_TESTS rule unless --pass-with-no-tests is set.
  • Update the report schema and fixtures, API types, docs, and skill references.

Issue

Part of #1855.

Verified

  • Core, e2e, and web builds passed.
  • e2e typecheck passed; 7 TODO-focused tests passed; all 41 report-schema fixture tests passed.
  • Core tests passed (130); docs check, changeset checks, and changed-file oxlint passed.
  • The full monorepo suite was not run on this update.

@github-actions github-actions Bot added the size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile label Nov 16, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 35 files

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Comment thread packages/e2e/src/run/runner.ts Resolved
Comment thread skills/e2e/references/running.md Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Comment thread docs/reference/cli.mdx Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 4 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Thanks for picking this up from #1855. Reviewed at ff34b2b. It works end to end. I checked it with the built CLI on a nested todo, a todo-only file (exit 0), test.only, a serial describe, tags, --shard, and --retries/--repeat-each, and the JSON, JUnit, Markdown, and HTML output all look right. pnpm check, oxlint, typecheck, the e2e unit suite, and the html-reporter and github tests pass. I approved fork CI.

Must-fix

  1. packages/github/src/merge.ts:71,87: summarize() puts any status other than passed, flaky, interrupted, or failed into skipped. The ...base spread then keeps the rerun's stale todo count and hides the missing field from TypeScript. To reproduce: a first run has 1 todo and 1 failed test, and the --last-failed rerun leaves the todo out. The folded summary is {"skipped":1,"todo":0}, but the markdown header says "1 todo". Count todo, and drop the spread so the compiler forces every field (or reuse the runner's computeSummary). Add a @e2e-dev/github patch changeset.
  2. The changeset doesn't list @e2e-dev/html-reporter, but packages/html-reporter/app/* changed. With onlyUpdatePeerDependentsWhenOutOfRange, the reporter won't be republished. The published one has no todo in TONE_ICON, so a report that contains a todo likely breaks it. Add '@e2e-dev/html-reporter': patch.
  3. Reporter changes are untested. With any of these removed, all 3822 unit tests and the todo integration test still pass: JUnit case 'todo' (junit.ts:149), the markdown "not implemented" note (markdown.ts:449), and the fileOutcome todo return (format.ts:351). list.ts:902,973 has no test either. Add golden cases to report-markdown.test.ts, report-list.test.ts, and the JUnit tests.

Should-fix

  • registry.ts:645: a body passed to test.todo is silently dropped. From JS, test.todo('x', async () => { throw ... }) runs as todo and exits 0. Throw a CollectionError when a second argument is given.
  • registry.ts:651: the placeholder body throws CollectionError('must never be scheduled') only to satisfy registerTest. That's the wrong error class for an internal invariant. Let registerTest take no body for todo, or pass a no-op.
  • build.ts:396: ReportSummary.todo is required in the type but optional in the schema. Make it optional in the type, with an "absent in older reports" note.
  • telemetry/events.ts:460 has no tests_todo, so the tests_* counts no longer add up to selected. Update docs/telemetry.mdx:145 to match.
  • markdown.ts testRow now nests skipped ? : todo ? :, and list.ts:902 adds another ternary level. Pull the per-status symbol and note into one helper.

Nits

  • format.ts:351: skipped + todo === total says it directly. The current passed + failed + interrupted + flaky === 0 breaks silently if a bucket is added.
  • list.ts hardcodes '○'; the file uses F_* glyph constants.
  • The Markdown row for a todo-only file shows 0ms; the list reporter hides it.
  • html-reporter/app/data.ts:128 sorts todo ahead of passed, against its own comment.
  • In running.md, the "(todo)" sentence belongs with the text-output description, not after the JSON one.

For the maintainer

  • The PR adds todo as a test mode, a selection disposition, and a result status. Shard, CLI list, and units each get a skip || todo branch. The alternative: keep todo as disposition: 'skip' with a todo cause until the result is built, so only nonRunResult and the reporters know about it.
  • A new ResultStatus value changes report-1 and the test-finished event without a schemaVersion bump. Is that OK as non-breaking?
  • list() now returns disposition: 'todo'. Is that meant to be public?

@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review. I pushed c3ad2ae with the fixes: TODO-aware --last-failed summaries; tests for the list, Markdown, JUnit, HTML, telemetry, and file outcome; runtime rejection of a body passed to test.todo; and the changeset/docs updates. The TODO-only Markdown file row also omits its zero duration.

list() returning disposition: 'todo' is intentional: TODOs are selected but do not run, so they need to remain distinguishable from skipped or filtered tests. The report object shape and required fields are unchanged; I treated todo as an additive status value. Consumers validating against an older closed schema will need the updated enum. If the report-versioning policy treats enum additions as breaking, please confirm whether this should bump the report schema version.

I left the HTML sort unchanged: its comment says TODO precedes passed, and the rank table matches that order.

Verification: pnpm run build and pnpm run check passed. Focused TODO e2e, GitHub merge, and HTML reporter tests passed. The full pnpm test run on Windows reached 4,622 passed, 168 failed, and 56 skipped; failures include symlink permissions, Git NUL handling, and POSIX path expectations in unrelated tests.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 20 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Comment thread packages/e2e/src/report/list.ts Resolved

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked c3ad2ae. All three asks are done: merge.ts counts todo (test fails without it), html-reporter and github are in the changeset, and the reporter branches have tests (14 of 16 mutants killed). The HTML sort pushback is fine. Fork CI approved. One regression from this commit keeps the change request.

Must-fix

  • packages/e2e/src/report/list.ts:972: failed and timed-out titles are no longer red. Main had pc.red(${F_CROSS} ${title}); now only the × is red. With colors: true the output is \u001b[31m×\u001b[39m <badge> tests/a.e2e.ts > t > boom. Every test uses colors: false, so nothing caught it. Use ${statusSymbol(...)} ${pc.red(title)} (cubic's suggestion) and add one colored assertion.

Should-fix

  1. statusPresentation in format.ts moves branching around more than it removes it: bucket duplicates statusBucket right above it, terminalNote covers only flaky/interrupted/todo while failed and skipped still build notes inline, markdownNote exists only for todo, tone is a string a second switch maps back to colors, and statusSymbol(pc, s, true) takes a bare boolean. Either shrink it to glyph maps (one for test rows, one for file rows) and keep notes inline, or make it own every note so call sites stop branching.
  2. markdown.ts fileRow hides the time only for fileOutcome(...) === 'todo' and calls tally(results) twice. A file of only skipped tests still shows 0ms. Key it on "no entry made an attempt" and tally once.
  3. html-reporter/app/ui.test.tsx is the first test under app/, which is why the vitest include changed. Package convention is tests/unit/ (like data.test.ts). Move it there and assert the icon name (dropping TONE_ICON.todo passes today, as does dropping the list.tsx legend entry).
  4. Nit: merge.ts:71 ReportSummary & { todo: number } is Required<ReportSummary>.

Maintainer questions still open: todo as a skip disposition with a todo cause vs a new status, whether a new ResultStatus value without a schemaVersion bump is non-breaking, and list() returning disposition: 'todo'.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked at 8af4f4c (rebased on 4bff6fc, merges clean into main fabb0c0). The list.ts regression is fixed: failed and timed-out titles are red again, and the new colored test fails when pc.red(title) is removed. The four should-fix items from the last round are done too: statusPresentation is gone and replaced by two glyph maps with one exhaustive color switch, notes are back inline, the Markdown file row hides the time when no entry made an attempt and tallies once, the HTML UI test lives in tests/unit/ and asserts the icon and the legend entry, and merge.ts uses Required<ReportSummary>.

Must fix

  • None.

Should fix

  • None.

Nits

  • markdown.ts testRow hides the duration on skipped || todo, but fileRow now keys on "an attempt ran". Keying both on result.attempts.length === 0 keeps them from drifting apart.
  • Only the red color is asserted. Changing interrupted from yellow to red, or dropping the todo dim, in coloredStatusSymbol still passes every test. One it.each over statuses with colors: true would pin the switch.

Verified

  • e2e unit suite: 3863 passed, 1 skipped (one run had a single failure that did not reproduce in 3 reruns, a load flake). Also passed: html-reporter (13), github (42), and the todo.test.ts integration test (2).
  • Typecheck passes for core, e2e, github, and html-reporter. Also clean: oxlint, check-docs-translations (ja and zh test.mdx mirror the new section and code block), check-docs-examples, check-docs-anchors, check-changeset-bumps, and sync-plugin --check.
  • Mutants on the new commits: 6 of 8 killed. Killed: red title, Markdown file-row time, file todo glyph, test todo glyph, HTML todo icon, HTML legend entry. Survived: the interrupted and todo colors.
  • Fork CI is waiting for approval (action_required on docs, spec, docs translations, benchmark, mobile). check is green.

This also overlaps #1887 (test.fixme). Merging the two only conflicts in tests/types/sdk-types.ts and tests/unit/registry.test.ts, and the fix is to keep both sides.

Waiting on a maintainer decision: todo as a new result status (this PR) vs a skip with a reason (as #1887 does fixme), and whether adding todo to report-1 without a schema bump is fine. Labeling for human review.

@okwasniewski
okwasniewski dismissed stale reviews from themself November 17, 2026 22:24

Earlier asks done, see latest automated review.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 17, 2026
kdy1
kdy1 previously requested changes Nov 18, 2026

@kdy1 kdy1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agents: Claude Opus 5.5 (claude-opus-5-5), GPT-6 Astra (gpt-6-astra) via Codex, GPT-6.1 Sol (gpt-6.1-sol) via Codex, Claude Sonnet 5.5 (claude-sonnet-5-5)

Thanks for adding test.todo. The basic cases work: a todo-only file exits 0, a todo has no attempts, JUnit writes <skipped message="todo: not implemented"/>, and test.todo('x', fn) fails collection. I ran the built CLI at head 8af4f4c with a fake engine. I found two problems that I think must be fixed before merge, and some smaller ones.

Must fix

1. A todo in a serial group runs and is reported as passed when a filter selects a sibling

packages/e2e/src/collect/select.ts:753-754

applySerialClosure changes every filtered member of a selected serial unit to run. It does not check for a todo. The todo's empty body then runs.

describe('flow', { serial: true }, () => {
  test('ready', async () => {});
  test.todo('future');
});
Command future Summary
e2e run todo passed: 1, todo: 1
e2e run --grep ready passed executed: 2, passed: 2, todo: 0
e2e run s.e2e.ts:3 passed executed: 2, passed: 2, todo: 0

The same occurs with --grep-invert, tags, and --last-failed after a sibling fails. If an earlier member fails, the todo is reported as skipped. A rerun of a failed serial flow with --last-failed is a common path, so the placeholder is counted as a passed test.

This change fixes it, and the e2e unit tests and todo.test.ts pass with it:

-      return { ...pair, disposition: 'run' as const, skip: undefined };
+      return { ...pair, disposition: pair.test.mode === 'todo' ? ('todo' as const) : ('run' as const), skip: undefined };

Another option is to reject test.todo in a serial group. Please add a test for serial + --grep and serial + file:line either way.

2. The Markdown file row loses its time for a file that has only serial tests

packages/e2e/src/report/markdown.ts:461

ranAnAttempt reads result.attempts. A serial member keeps its attempts on the group, so result.attempts is empty and the time cell is blank. For the same serial-only file, main shows 83ms and this branch shows an empty cell. Use entry.final.attempts.length > 0.

Should fix

3. A todo under --last-failed clears a beforeAll failure

packages/e2e/src/run/last-run.ts:167

passedAgain accepts any selected result in the hook's scope that is not skipped. A todo matches, but it does not run the hook.

describe('d', () => {
  beforeAll(async () => { throw new Error('hook broke'); });
  test('a', async () => {});
  test.todo('t');
});

Run 1 exits 1. Run 2, e2e run --last-failed --grep 't$', exits 0 with carried.errors: [], but the hook is still broken. Test a is selected again in run 3, so the effect is limited to the report and the GitHub comment of run 2. Add && result.status !== 'todo' (or require result.attempts.length > 0). last-run.test.ts passes with that change.

4. A todo-only project fails on an empty shard

packages/e2e/src/collect/select.ts:807

With only todos, --shard 1/2 exits 0 and --shard 2/2 exits 2 with NO_TESTS, which calls the todos "unselected". This does not agree with the new docs, which say a todo-only run does not fail. Also, a todo that this line moves to another shard is reported with the reason not selected, not outside the shard.

5. An earlier @e2e-dev/html-reporter crashes on a report with a todo

The published reporter has no todo entry in TONE_ICON and TONE_TEXT, so it throws Element type is invalid and does not write the page. Its peer range is e2e >=0.23.1 <1, so a user who updates only e2e gets this crash. The same applies to other consumers of the ResultStatus union and the report-1 status enum. A fallback for unknown statuses in the reporter would also prevent this for the next status.

Small items

  • docs/reference/cli.mdx:794, and the ja and zh pages: the sentence that says the counts add up to selected does not include todo.
  • docs/reference/test.mdx, #### test.todo: there is no Errors table, as the other entries have. The example uses test.describe, but the rest of the page imports describe.
  • packages/html-reporter/app/styles.css:99: --color-status-todo has the same value as skipped, so the run bar does not show todo and skipped as different segments.
  • The ## Verified section in the PR body refers to c701e19 and ff34b2b, not the head commit.

Questions for @okwasniewski

  • Must todo be a new status, or a skip reason as test.fixme is in #1887?
  • Is a patch changeset correct for a new value in the ResultStatus union and the report-1 status enum (see item 5)?
  • Is it intentional that a todo-only run exits 0 but a skip-only run exits 2 (NO_TESTS)?

@okwasniewski okwasniewski removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 18, 2026
@bferanmi806-sketch
bferanmi806-sketch force-pushed the codex/issue-1855-test-todo branch from 8af4f4c to af378a6 Compare November 18, 2026 18:34
@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

Implemented the follow-up review fixes: serial closure preserves TODO status; TODO-only empty shards succeed and out-of-shard TODOs show the correct reason; --last-failed requires an actual attempt before clearing hook failures; Markdown file timing includes serial attempts; and the HTML reporter gives TODO a distinct tone with a safe unknown-status fallback.

Regression coverage, localized docs, and the TODO summary/reporting docs are updated. Focused tests, builds, typechecks, docs checks, and the reporter’s desktop/mobile light/dark review passed. The full monorepo suite was not run on this update. The report-1 schema-version question remains open.

@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

@okwasniewski, the follow-up fixes are pushed at af378a6 and the updated CI checks are green. I refreshed the verification section; the report-1 versioning question remains open there. Could you review this update and advise on the schema-version question?

@kdy1
kdy1 dismissed their stale review November 18, 2026 19:17

All requested changes are in as of af378a6. Checked and dismissed by a T3 Code automation (Claude) for @kdy1.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked at af378a6 (base 9d240ac, merges clean). kdy1's asks are mostly done. The serial closure keeps a todo as todo. --last-failed needs a real attempt before it clears a hook failure. The Markdown file row reads final.attempts. Todos moved off a shard now say outside the shard. cli.mdx counts todo in the sum, and the HTML todo tone is distinct with an unknown-status fallback. The new select, last-run, markdown, and dot tests fail when their fix is reverted.

Must fix

  • packages/e2e/src/collect/select.ts:375-379 (todoOnlyShard): this special-cases one shape instead of fixing a rule, and it contradicts the --shard docs ("A shard with no test is NO_TESTS unless --pass-with-no-tests"). Add one test.skip to the todo-only file and --shard 2/2 exits 2 with NO_TESTS again, while the same file without --shard exits 0. One real test plus todos on --shard 2/2 is also NO_TESTS. Drop the predicate and keep the documented rule: a shard that runs nothing is NO_TESTS, and --pass-with-no-tests covers it. Keep the outside the shard reason fix. If todo-only shards really must pass, put that in the rule that decides NO_TESTS for every non-running disposition, not in a predicate that needs every test in the project to be a todo, and document it in the --shard row.

Should fix

  • docs/reference/test.mdx #### test.todo and the ja/zh mirrors: the Throws table says INVALID_ARGUMENT, but registry.ts:755 throws CollectionError, which is COLLECTION_ERROR.
  • --shard row in docs/reference/cli.mdx:639: "Skipped tests are not cut" now also applies to todos. Say so in one sentence.
  • kdy1's item 5 is only half fixed. The resultTone fallback protects future reporters, but a published @e2e-dev/html-reporter (peer e2e >=0.23.1 <1) still crashes on a report that contains a todo. This can't be fixed on the reporter side. It depends on the status-model decision below.

Verified

  • Built core, e2e, web, github, and html-reporter. e2e unit: 4131 passed, 2 skipped. todo.test.ts: 6 passed. html-reporter: 25 passed. github: 42 passed. Typecheck (e2e, html-reporter), oxlint on changed files, check-changeset-bumps, and sync-plugin --check are clean.
  • Mutants on af378a6: 6 of 6 killed. Killed: the serial closure, the todo-only shard predicate, the shard reason, last-run attempts, the Markdown final.attempts, and the dot glyph. The select mutants were run against a rebuilt dist.
  • Shard probes against the built runner: todo-only --shard 2/2 exits 0. todo + test.skip on --shard 2/2 exits 2 (NO_TESTS), but exits 0 without --shard. One test + one todo on --shard 2/2 exits 2 (NO_TESTS). skip-only exits 2 on both shards.
  • CI at af378a6: build, check, docs, install, and bun are green. test (22/24/26), android, and ios are still running, so this isn't all green yet.

Still waiting on the maintainer decision about a new todo status vs a skip reason. See kdy1's questions.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 9 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

@okwasniewski, thanks for the review. I removed todoOnlyShard: an unsharded TODO-only run still passes, while a shard with no selected tests returns NO_TESTS unless --pass-with-no-tests is set. I added coverage for TODO-only, TODO+skip, and runnable+TODO cases, corrected the COLLECTION_ERROR docs, and updated the shard docs in English, Japanese, and Chinese.

The focused shard unit test and all 6 TODO integration tests pass; the docs check passes. The three positional file:line tests fail on this Windows setup on both 271a281 and the untouched af378a6 baseline. The checks currently shown for 271a281 are passing.

Could you confirm whether todo should remain a distinct public result and list() disposition, and whether adding it to report-1 needs a schema-version bump? That decision also resolves compatibility expectations for older published HTML reporters.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 271a281 (main 402a615, merges clean). Everything from my last review is done:

  • todoOnlyShard is gone. select() uses one rule again: a run that selects no runnable or todo test is NO_TESTS unless --pass-with-no-tests. An unsharded todo-only run exits 0, and an empty shard exits 2. Every one of the shapes I listed now behaves the same way: todo only, todo + test.skip, and test + todo on --shard 2/2.
  • The outside the shard reason is kept.
  • The test.todo Throws table says COLLECTION_ERROR in en/ja/zh.
  • The --shard row says that skipped and TODO tests are not cut.

The new commit has no regressions.

This now matches Vitest. On Vitest 5.1.0, a todo-only file exits 0 and an empty --shard 2/2 exits 1 unless --passWithNoTests. Playwright has no test.todo, and it counts tests before sharding (testCountBeforeSharding in runner/tasks.ts), so an empty shard passes there. e2e's documented --shard rule follows Vitest, and the PR keeps that rule.

Still open (waits on the status decision, not on the author)

  • kdy1's item 5: a published @e2e-dev/html-reporter (peer e2e >=0.23.1 <1) still crashes on a report that has a todo status. The reporter cannot fix this. It goes away if todo becomes a skip reason, or needs a peer floor bump if todo stays a status.
  • A skip-only run is still NO_TESTS, but a todo-only run passes. Vitest passes both. This is kdy1's third question and comes from main's rule, not from this PR.

Verified

  • Built core, e2e, and web. select.test.ts + last-run.test.ts: 77 passed. todo.test.ts: 6 passed. e2e typecheck, oxlint on the changed files, and check-changeset-bumps are clean.
  • Mutants, run against a rebuilt dist: 2 of 2 killed.
    • Any todo in the project suppresses NO_TESTS: 3 tests fail.
    • Todos stop counting as selected: 4 tests fail.
  • Vitest probes in a scratch project: todo-only exits 0, skip-only exits 0, --shard 2/2 on one file exits 1.
  • CI at 271a281: check and cubic are green. docs, docs translations, spec, mobile, and benchmark show action_required because the fork workflows still need approval.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 40c845b (merge of main 1b007d4 into 271a281), against main e88153b. The merge commit resolves its conflicts correctly: the docs tables keep test.todo next to test.each/test.for, and mcp-run-tests.test.ts stays deleted as on main. Nothing in it regresses the earlier fixes. The PR now conflicts with #1887 (test.fixme), which landed after this merge.

Must fix

  • Rebase onto main. packages/e2e/src/collect/registry.ts, tests/types/sdk-types.ts and tests/unit/registry.test.ts conflict with #1887. Each side adds a TestMode value and a TestAPI method in the same places. Do this together with the item below, because #1887 changes how todo should be shaped.

Should fix (waits on a maintainer call, see below)

  • Report todo the way #1887 reports fixme: status: 'skipped' with skip.cause: 'todo', not a new todo result status. Main now has the extension point for this. Add 'todo' to SELF_SKIP_CAUSES in packages/core/src/run/records.ts, then give test.todo a TestMode 'todo' that classifyPair turns into disposition: 'skip' with { cause: 'todo', reason: 'todo' }, as it does for fixme. Route it through registrar('test.todo()', ...) so a serial group rejects it with an API-named error, as it rejects test.skip/test.fixme/skipIf/runIf. This change:
    • removes the new ResultStatus/ExecutedResultStatus, the report-1 status enum value, the attempts maxItems 0 schema branch, summary.todo, the todo disposition in select.ts/runner.ts/units.ts, and most of the list/markdown/junit/github/html-reporter edits. The PR shrinks a lot, and shard, serial-closure and --last-failed handling reuse the paths skip already has.
    • fixes kdy1's item 5: a published @e2e-dev/html-reporter (peer e2e >=0.23.1 <1) crashes on a todo status but shows an unknown skip cause like any other skip.
    • matches Vitest's reporter API. There test.todo is state: 'skipped' with options.mode: 'todo' (TestResultSkipped in vitest 5.1.0), and only the CLI summary prints "N todo". If we want that summary line, the list reporter can count skips whose cause is todo. That needs no new status.
    • Playwright has no test.todo. Its closest API, test.fixme, is a skip with an annotation, and #1887 already follows that.
  • Whether a todo-only run passes. A fixme-only run is NO_TESTS on main ("marked fixme"), and so is a skip-only run. As a skip cause, todo-only would also be NO_TESTS ("marked todo") unless --pass-with-no-tests is given, and the todo exception in select() and in the exit-code text (was marked todo) would go. Vitest passes all three, so if parity is the goal it is the shared rule that changes, not one exception for todo.

Verified

  • Built core, e2e and web at 40c845b. select, last-run, registry, report-list, report-markdown and integration/todo: 293 passed. e2e tsc --noEmit is clean.
  • git merge-tree against main e88153b conflicts only in the three files above.
  • CI at 40c845b: check, cubic, pr-size and pr-policy are green. mobile, docs, docs translations, spec and benchmark are action_required because the fork workflows still need approval.

@okwasniewski okwasniewski left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Posted by mistake by the automated triage script (empty review). Please ignore it; the earlier review still stands.

@bferanmi806-sketch

bferanmi806-sketch commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

The Nov 20 review says this branch now conflicts with #1887 and recommends representing test.todo as status: 'skipped' with skip.cause: 'todo', instead of adding a new public result status. That would also avoid breaking older HTML reporters. I asked about the status/schema choice earlier; could you confirm whether to switch to the skip-cause model, and whether report-1 needs any version change? The conflicting files overlap that model decision, so I’ll rebase and update them together once confirmed.

@okwasniewski

Copy link
Copy Markdown
Member

[claude-opus-5-5] automated review on behalf of @okwasniewski

@bferanmi806-sketch yes, switch to the skip-cause model. #1887 set the precedent for test.fixme (merged as 198d25f): the test reports status: 'skipped' with skip.cause: 'fixme' in report-v1, no new result status and no report version change. For test.todo:

  • add 'todo' to SELF_SKIP_CAUSES in packages/core/src/run/records.ts, so every consumer that already counts a self-given skip (serial member accounting, Skipped After Failure, the GitHub merge summary, NO_TESTS, --last-failed) picks it up without new branches
  • drop the new public todo status and the HTML reporter changes that read it
  • keep report-v1 as is; a new cause value is additive, same as fixme

Then rebase on main and resolve the conflicts with that model. We'll re-review after the push.

@bferanmi806-sketch
bferanmi806-sketch force-pushed the codex/issue-1855-test-todo branch from 40c845b to cfafc2f Compare November 24, 2026 10:42
@github-actions github-actions Bot added size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile and removed size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 24, 2026
@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and switched to the approved report-v1 shape: test.todo(title) registers without a body and is reported as selected skipped, with skip.cause and reason todo, and no attempts.

I added coverage for TODO-only NO_TESTS, --pass-with-no-tests, and valid/invalid report fixtures, and updated the API types, docs, and skill references. Core/e2e/web builds, e2e typecheck, the 7 TODO-focused tests, all 41 report-schema fixture tests, 130 core tests, docs checks, changeset checks, and changed-file lint pass locally. The full monorepo suite was not run on this update.

Please re-review this update when convenient.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked cfafc2f (one commit on main 2f07acd, merges clean into main 5db0f41). The switch to the #1887 model is done: test.todo(title) registers through registrar('test.todo()', 'todo'), classifyPair gives it disposition: 'skip' with { cause: 'todo', reason: 'todo' }, 'todo' is in SELF_SKIP_CAUSES, and the report-1 schema only gains the enum value. The new result status, summary.todo, the todo disposition, the reporter/html-reporter/github edits and todoOnlyShard are all gone, so every earlier ask (mine and kdy1's) is either done or no longer applies: a todo in a serial group is a COLLECTION_ERROR, --last-failed leaves it out and cannot clear a hook failure with it (no attempt, cause not undelivered), reporters print the reason like any other skip, and an older @e2e-dev/html-reporter renders it as a plain skip.

Must fix

  • None.

Should fix

  • .changeset/test-todo.md: #1887 shipped the new fixme cause as a minor whose summary opens with **Breaking:** and tells users to update pinned copies of schema/report-v1.schema.json and exhaustive skip-cause checks (.changeset/test-fixme.md on 198d25f). todo is the same kind of change, so the changeset should say the same, otherwise a consumer with a pinned schema finds out from a validation error. (Maintainer call on patch vs breaking minor, see below.)
  • packages/e2e/src/collect/registry.ts:779-791: todo deepens two nested ternaries that both switch on the same skip argument (3 levels each now). One lookup keyed by the registration kind keeps it flat, e.g. const registered = skip === 'fixme' ? { mode: 'fixme', reason: fixmeReason() } : skip === 'todo' ? { mode: 'todo', reason: 'todo' } : undefined, then build options and mode from it once. Same in select.ts:727: cause: test.mode === 'fixme' || test.mode === 'todo' ? test.mode : 'explicit'.

Nits

  • docs/reference/test.mdx #### test.todo: test.fixme has a Throws table; the todo section states the serial-group COLLECTION_ERROR in prose. A two-row table (serial group, body passed) would match the page.
  • The serial-group error for test.todo() ends with "set skip on the serial describe instead", which reads oddly for a placeholder. Fine to keep if you prefer one message for every registered skip.

Verified

  • Built core, web and e2e. registry, select, schema-fixtures, last-run, runtime-skip unit tests and integration/test-todo.test.ts: 187 passed. e2e and core tsc --noEmit, oxlint on changed files, check:changeset-bumps, check:peer-ranges, plugins:check, docs:check, docs:check-errors are clean.
  • Mutants against the unit tests, 6 of 6 killed: todo cause -> explicit in classifyPair, dropping the marked todo NO_TESTS case, dropping the body guard, todo reason -> true, todo mode -> skip, todo removed from the schema enum.
  • Probe: test.todo inside a tagged describe keeps the group's tags and title path, reports skipped with no attempts, and its source position matches what test.fixme gets in the same file.
  • CI at cfafc2f: check, pr-policy, pr-size green. docs, docs translations, mobile, spec and benchmark are action_required (fork workflows need approval), which is why mergeable_state is unstable. cubic did not run (incremental review failed to start), not a finding.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 24, 2026

@michal-e2e michal-e2e left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Reviewed at cfafc2f31 (merge base 2f07acd18).

The skip-cause design works through the CLI. Please enforce the same registration-only rule in the report contract.

Must fix

  • The report schema accepts a TODO with execution records. I started with the valid fixture and ran two separate checks. The schema accepted a runtime attempt relabelled as todo and accepted a TODO result carrying an existing valid attempt. A report consumer can then count a placeholder as executed, even though the CLI gives it zero attempts. The public Report type also accepts a todo attempt on the head. The same TypeScript input is rejected on the merge base. Please restrict todo to ordinary result-level skips, require zero attempts for that cause, and add negative fixture assertions for both invalid shapes. Preserve the existing runtime fixme behavior and TODO rows outside the shard. Report schema · Attempt type

Optional

  • In the TODO reference, say the selection fails by default and name --pass-with-no-tests. The built CLI exits 0 and includes the TODO when I pass that flag. Test reference
  • Keep the assertion for result-level fixme alongside the attempt-level assertion. The previous fixture test checked both fields. The revised test checks the attempt field alone. Schema fixture test

For the maintainer

  • I confirmed the compatibility issue from the code owner's review. The previous report schema rejects the actual CLI output at skip.cause. The breaking changeset for fixme came through the follow-up to its merge. Changeset follow-up

Verified

  • The built CLI fails with COLLECTION_ERROR on the merge base, where test.todo is absent. The head reports a selected TODO as skipped with zero attempts. A TODO-only selection exits 2 with NO_TESTS by default and exits 0 with --pass-with-no-tests. Serial registration and a body argument raise COLLECTION_ERROR.
  • The Chromium check passed through the built web engine on both revisions. At the head, list shows the TODO as a skip with reason todo, --last-failed excludes it, and sharding keeps the original TODO cause when it is outside the current shard. The mobile SDK import also registered and reported a TODO through the built CLI with a test engine. The scratch schema trial accepted the real mixed and sharded reports and rejected both impossible execution shapes.
  • pnpm check, the workspace package suites, the script tests, the testbed, and the deterministic web benchmark passed locally at the head. Eight recorded web-agent cases passed under --strict-cache. The testbed and both web benchmark reports passed the report consistency checks.
  • Assertions caught ten of the eleven runtime mutations. The remaining mutation removed TODO from runtime self-skip accounting and survived the targeted reporter and lifecycle tests. Registered TODOs do not reach that path. All seven TODO-specific tests failed under at least one mutation. Both type checks caught deliberate changes to the public signature.
  • Packaged candidate e2e passed a Chromium flow with the published web engine.
  • The Android benchmark's microphone-denial test failed with ENGINE_FAILURE because the alert stayed visible after dismiss. The same test produced the same error on the merge base with the same emulator. The head benchmark and base-control reports passed the report consistency checks.
  • The iOS benchmark finished with 55 passes and six failures. Each failing case reproduced on the clean merge base on the same simulator, with the same error code and message. The head and base-control reports passed the report consistency checks.

Not run

  • Published-runner compatibility in the reverse direction. npm has no stable e2e version in the candidate web engine's declared peer range. The local merge-base and head Chromium checks used each checkout's built packages.
  • Live model-backed benchmark scenarios. The local agent benchmark used committed recordings.

@michal-e2e michal-e2e removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 24, 2026
@bferanmi806-sketch
bferanmi806-sketch force-pushed the codex/issue-1855-test-todo branch from cfafc2f to ae61c7c Compare November 24, 2026 22:11
@github-actions github-actions Bot added size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile and removed size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 24, 2026
@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I pushed ae61c7c8 with the report-contract fixes:

  • TODO is restricted to ordinary result-level skipped rows with skip.cause: todo and zero attempts. Attempts cannot use the TODO cause.
  • Schema and public-type tests reject TODO attempts and invalid setup, serial-group, and expected-failure fields. The result-level fixme and out-of-shard TODO cases remain covered.
  • GitHub and HTML reporter fixtures now exclude TODO rows when constructing attempt-bearing results.

Core and e2e builds passed. Core, e2e, GitHub, and HTML reporter typechecks passed. Focused checks passed: 75 e2e tests, 27 GitHub fold tests, and 24 HTML reporter tests. The full GitHub package suite had one unrelated Windows path-link assertion failure (53/54 passed); I have not verified that failure against the base revision. The new GitHub checks are queued.

Could you review the updated head when convenient?

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked ae61c7c (two commits on main 5711573, merges clean). My earlier asks are done: the changeset is now a minor with **Breaking:**, worded like fixme's, and the nested ternaries in registry.ts and select.ts are flat. The test.todo docs have a Throws table and name --pass-with-no-tests. michal-e2e's must-fix is done in the schema. todo is allowed only in a result-level skip, attempt and serial skips reject it, and a todo row must be a kind: 'test' row with no serialGroupId, no expectedFailure, and zero attempts. The negative fixture tests catch each of those. His optional result-level fixme assertion is back too.

Must fix

  • packages/e2e/src/report/build.ts:356-371: turning the public ReportResult into a union whose todo branch has attempts: readonly [] breaks the Report type for reporter authors. Code that compiles on 0.24.0 no longer does. For example, (r: Report['run']['results'][number]): typeof r => ({ ...r, attempts: r.attempts.map((a) => ({ ...a, artifacts: [] })) }) now fails with Type ... is not assignable to type 'readonly []' (I checked it against the built e2e types). This PR's own consumers needed workarounds: Extract<ReportResult, ...> / Exclude<..., { cause: 'todo' }> in tests/helpers/report.ts, report-ctrf, report-markdown, report-failure-text, packages/github/tests/unit/fixtures.ts, fold.test.ts, and an as AttemptReportResult cast in the html-reporter test. michal's ask covered the schema and the attempt type, and both are already handled: ReportAttempt.skip is AttemptSkipInfo, and the schema enforces zero attempts on a todo row. Please make ReportResult an interface again, with skip?: SkipInfo. Keep AttemptSkipInfo on attempts, serial members, and groups. Then drop the todo branch in serializeResult, including its plain throw new Error('invalid TODO result record'), which nothing can reach (removing it leaves all 4,855 unit and integration tests passing). Drop the test-helper Extract types as well.

Should fix

  • packages/e2e/src/run/units.ts:213-216: the skip.cause !== 'todo' check in isAttemptSkipInfo can never fire, because an interrupt's signal.reason is always a runner skip. Removing it fails no test. Keep the old isSkipInfo body and narrow only its return type.
  • packages/e2e/schema/report-v1.schema.json resultSkip: no test covers the cause: todo -> reason: 'todo' rule, and deleting it fails nothing. Add one negative assertion to accepts a selected todo result without attempts (for example todo.skip.reason = 'later' -> invalid).

Verified

  • Built core, e2e and web. schema-fixtures, report-fold, registry, select, last-run, report-markdown, report-ctrf, report-failure-text and integration/test-todo.test.ts: 305 passed.
  • Mutants: 4 of 7 killed. Dropping the fold.ts todo guard, removing maxItems: 0, adding todo to the attempt skip enum, and removing the kind: test rule each fail a test. These survive: the reason: todo rule, the build.ts throw, and the units.ts todo check (see above).
  • The fold.ts guard is needed. Without it, --last-failed on a test that failed and was then changed to test.todo folds the old attempts into a todo row, and the new schema rejects that row.
  • CI at ae61c7c: check, pr-policy and pr-size passed. spec, mobile, docs, docs translations, benchmark and microbench are action_required (fork workflows waiting for approval), so mergeable_state is unstable. cubic did not run on this head ("incremental review could not start"). Its earlier comments from Nov 16-17 were about the removed todo disposition and status and no longer apply.

Note: #2218 (KrzysztofMoch) takes over this PR with your first commit plus the breaking changeset. Which of the two lands is a maintainer decision.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

Comment thread packages/e2e/src/run/units.ts Resolved
Comment thread packages/e2e/tests/types/sdk-types.ts Resolved
Comment thread packages/e2e/tests/helpers/report.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 4 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I pushed b7055a44 and 5310e44b to address the report-contract feedback:

  • ReportResult is back to a single interface with skip?: SkipInfo; TODO-only row rules stay in the schema.
  • Removed the TODO-only serializer branch and unreachable throw, and restored direct serialization in the existing key order.
  • Removed the Extract/Exclude and cast workarounds; added a reporter-transform type check and a schema assertion for an invalid TODO reason.
  • Kept isAttemptSkipInfo free of the impossible TODO check and narrowed interrupt-message skips to AttemptSkipInfo.
  • TODO fixtures now default to status: skipped with no attempts; the fold regression covers that behavior.

Verification: e2e, GitHub, and HTML reporter typechecks passed; 188 focused e2e report/schema/TODO tests, 27 GitHub fold tests, and 8 HTML reporter tests passed.

@okwasniewski
okwasniewski dismissed their stale review November 25, 2026 04:16

Superseded by the latest automated re-check.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 5310e44 (b7055a4 and 5310e44 on top of ae61c7c; base 5711573, merges clean with main 2dfa407). All asks from my last review are done. ReportResult is a single interface again with skip?: SkipInfo. The todo branch and the unreachable throw are gone from serializeResult, and its key order matches main. The Extract/Exclude helper types and the html-reporter cast are gone. isAttemptSkipInfo no longer checks for todo, and InterruptMessage.skip is now AttemptSkipInfo. The schema test now asserts that cause: todo with reason: 'later' is invalid. The new remappedReportResult type check in sdk-types.ts catches the reporter-transform break I reported.

Must fix

  • packages/html-reporter/tests/unit/reporter.test.ts:9: type ReportResult = Report['run']['results'][number]; is now unused, so pnpm lint fails with eslint(no-unused-vars). It is the only oxlint error in the repo. The spec workflow runs pnpm lint, so it goes red as soon as fork CI is approved. Delete the alias.

Should fix

  • Some union-era workarounds are still there. Now that ReportResult is an interface again, revert them to main:
    • packages/html-reporter/tests/unit/reporter.test.ts:116-117: the first.skip?.cause === 'todo' throw and the const executable = first alias. withArtifacts can be main's version again.
    • packages/e2e/tests/helpers/report.ts:18: ReportResultOverrides is now the same type as Partial<ReportResult>. Keep the todo defaults in reportResult, but drop the exported type and the report-failure-text.test.ts import of it.
    • packages/github/tests/unit/fixtures.ts:21 (! instead of as ReportResult), packages/github/tests/unit/fold.test.ts:448 and packages/e2e/tests/unit/report-ctrf.test.ts:449. These parameters now spell out the serial-member skip type where main had ReportResult['skip']. Nothing needs that any more.

Verified

  • Built core, e2e and web. Typecheck passes for core, e2e, github and html-reporter. check:dead-code and check:changeset-bumps pass.
  • Tests: schema-fixtures, report-fold, registry, select, last-run, report-markdown, report-ctrf, report-failure-text and integration/test-todo (305 passed), github fold (27 passed), html-reporter reporter (8 passed).
  • Mutants: 3 of 3 killed. Dropping the schema's reason: todo rule fails the new assertion. Dropping the fold.ts todo guard fails the fold regression. Making reportResult give todo rows an attempt fails the fold regression too.
  • cubic's two open threads on b7055a4 are not real, and your replies are right. The interrupt path only ever carries an AttemptSkipInfo, and it is typed that way at the protocol now. The todo row rules belong in the schema, which has negative tests for each of them, and not in a public union type. Its third finding (the helper default) is fixed in 5310e44.
  • CI at 5310e44: check, pr-policy, pr-size and cubic passed. spec, mobile, docs, docs translations, benchmark, microbench and review-verdict are action_required (fork workflows waiting for approval). Once spec runs, the lint error above will fail it. mergeable_state: blocked comes only from my standing CHANGES_REQUESTED review: main requires 0 approvals and no checks, and nobody else has a review request open.

Note: #2218 (KrzysztofMoch) is a competing take on test.todo. Which one lands is a maintainer decision.

@kdy1

kdy1 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agent: Claude Sonnet 5.5 (claude-sonnet-5-5)

Thanks for the work on test.todo, @bferanmi806-sketch, and for all the rounds of review fixes.

#2218 took over this PR and merged on 2026-11-25. It keeps your first commit with your authorship, and the follow-up commits carry the schema restriction and fold guard from your later commits here. test.todo is now on main, so I am closing this PR as superseded. The #1855 checklist entry for it is done.

@kdy1 kdy1 closed this Nov 26, 2026
@bferanmi806-sketch

Copy link
Copy Markdown
Contributor Author

Thanks, @kdy1, for the kind note and for keeping my first commit on #2218 with my authorship intact. I appreciated the detailed reviews and your guidance on the skip-cause model. I’d be glad to help with another scoped e2e task when there’s a good fit—feel free to assign me one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants