Repository navigation
feat(test)!: add test.todo - #2218
Conversation
🟢 e2e web: 95 passedAll 95 tests in 43 files
Tested by e2e 0.24.0 · 1m 2s · web · run artifacts |
🟢 e2e web agent: 34 passed35 agent steps · 26 replayed from cache · 25 model calls · 134.2k tokens (94% cached) · $0.0055 All 34 tests in 5 files
Tested by e2e 0.24.0 · 1m 27s · web · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 33 model calls · 196.1k tokens (87% cached) · $0.0112 All 20 tests in 1 file
Tested by e2e 0.24.0 · 5m 15s · android-emulator · run artifacts |
🟢 e2e ios: 61 passed, 1 skippedAll 62 tests in 7 files
Tested by e2e 0.24.0 · 7m 14s · ios-simulator · run artifacts |
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 12 replayed from cache · 51 model calls · 325.4k tokens (84% cached) · $0.0207 All 22 tests in 1 file
Tested by e2e 0.24.0 · 7m 26s · ios-simulator · run artifacts |
🟢 e2e android: 62 passed, 1 skippedAll 63 tests in 7 files
Tested by e2e 0.24.0 · 8m 54s · android-emulator · run artifacts |
|
Thanks for carrying Since the description says #2218 replaces #1858, I want to avoid leaving those fixes behind. Would you like me to cherry-pick them onto your branch, or should I leave #1858 open until you confirm your branch has the follow-ups? |
kdy1
left a comment
There was a problem hiding this comment.
Note
This text was drafted with AI and posted after human approval.
- Harness: T3 Code
- AI agents: coordinator: Claude Opus 5.5 (claude-opus-5-5), reviewer: GPT-6.2 Astra (gpt-6.2-astra), reviewer: GPT-6.2 Sol (gpt-6.2-sol), reviewer: Claude Opus 5.5 (claude-opus-5-5), reviewer: Claude Sonnet 5.5 (claude-sonnet-5-5)
Verdict: Approve with changes
This review approves the pull request with changes. Fix the P2 items before merge.
This pull request adds test.todo(title). The test is registered without a body, never runs, and is reported as skipped with skip.cause and skip.reason both todo. I ran the built CLI at db5964e: a mixed file reports the todo as [todo] with zero attempts, a todo-only selection fails with NO_TESTS and passes with --pass-with-no-tests, and a body or a serial group gives COLLECTION_ERROR. The changed unit tests (181), tests/integration/test-todo.test.ts (3), and pnpm --filter e2e run typecheck pass. The report-1 change follows the test.fixme precedent (#1887, #2012) that the maintainers chose on #1858. One gap remains in the schema, below. The branch also conflicts with main after #2223 (the docs pages and the skip-cause enum, which lost capability-unavailable), so it needs a rebase.
Reviewed commit: db5964e55e1366c0d445d3a5c46deb6d75e91f03
- P2 (fix before merge): 1 (1 inline)
… tests Mark the changeset minor with a Breaking note for the new todo skip cause, as #2012 did for fixme. Add a Throws table for test.todo, name the fix in its extra-argument error, pin todo in last-run and the Report type, restore main's fixme schema-fixture test, and drop the todo filter fixture, which the cause-agnostic filter rule already covers.
report-1 took `todo` in the skip definition that results, attempts, and serial members share, so a report with a todo attempt, or a todo result with attempts, validated. `todo` now lives in a result-only `resultSkip` with reason `todo`, and a todo result must be a plain test row with no serial group and no attempts. That rule caught a real case: a failed test turned into a test.todo and rerun with --last-failed inherited its old attempts in report-with-reruns.json. foldLastRun now leaves a todo result as it is. Co-authored-by: Enoch <bferanmi806@gmail.com>
db5964e to
1796f37
Compare
|
Thanks, Enoch. #2218 now has the report-1 restriction ( |
|
Thanks, Krzysztof! I appreciate you carrying #2218 through and crediting the report-1 restriction and fold guard. Glad |
What
test.todo(title)registers an unfinished test with no body, as in Vitest. It never runs and is reportedskippedwithskip.causeandskip.reasonbothtodo.This takes over #1858 by @bferanmi806-sketch (Enoch). Their first commit is kept with its authorship, and three commits on top finish it; the last ports the schema restriction and fold guard from Enoch's later #1858 commits.
Why
Vitest suites use
test.todoto keep planned tests visible, and a port to e2e had nothing for it. On #1858 the maintainers chose to model it liketest.fixme(#1887): a skip cause, not a new result status, so report-1 keeps itsschemaVersionand reporters need no change.How it works
test.todo(title)rejects any argument after the title with aCOLLECTION_ERRORthat points totest.skip(title, fn)ortest.fixme(title, fn). Otherwise it callsregisterOnewith modetodoand an empty body (packages/e2e/src/collect/registry.ts). As withtest.fixme,registerOnerejects it inside a serial group.todointoskip: { cause: 'todo', reason: 'todo' }, besidefixmeandexplicit(classifyPairinpackages/e2e/src/collect/select.ts).NO_TESTScounts these tests asmarked todo.'todo'joinsSELF_SKIP_CAUSES(packages/core/src/run/records.ts), the causes a test gives itself, which types theskip.causeunion. No other runner code changes:--last-failedreruns only skips the runner gave (UNDELIVERED_SKIPSinpackages/e2e/src/run/last-run.ts), so a todo in the run before is not rerun, and the reporters print a todo like any skip with its reason.todois a result-only skip cause. A newresultSkipdefinition (packages/e2e/schema/report-v1.schema.json) takes any attempt skip, or{ cause: 'todo', reason: 'todo' }with an optionalotherShard, and a todo result must be akind: testrow with noserialGroupIdand no attempts. Attempts and serial members keep the oldskipdefinition, so they rejecttodo. The valid fixture gains a todo result, andschema-fixtures.test.tschecks each rejected shape. The TypeScriptReporttype keeps oneSkipInfofor results and attempts, as it already does forfiltered, which the runner only puts on results; fortodothe schema holds the rule.foldLastRun(packages/e2e/src/report/fold.ts) leaves a todo result as it is. Without that, a test that failed, became atest.todo, and was rerun with--last-failedkept its old attempts inreport-with-reruns.json, which the schema above rejects.minorwith**Breaking:**fore2eand@e2e-dev/core, matching fix(changeset): flag test.fixme report compatibility #2012 forfixme: a consumer pinning the schema or switching exhaustively onskip.causemeets a new value.test.todoentry with aThrowstable indocs/reference/test.mdx,test.todo(title)in the serial-groupThrowsrow, and a line inskills/e2e/references/writing-tests.mdand its plugin copy. Enoch'sdocs/jaanddocs/zhentries are in, without the laterThrowstable. Types are pinned inpackages/e2e/tests/types/sdk-types.ts, including the rejected body form andtodoas aReportskip cause.The CTRF reporter (#2137) shows a todo as
skippedwithskipCause: todoin itsextra. CTRF'spendingstatus would also fit. I left that for a follow-up so todo reads the same in every reporter.Issue
Part of #1855. Replaces #1858.
Verified
Ran it locally: yes
describe, a top-level todo, and a passing test:report.jsonfor the two todo tests:test.todoNO_TESTS: ... 1 marked todo; pass --pass-with-no-tests to allow this--pass-with-no-testsskippedwith causetodotest.todo, rerun with--last-failed↓ later [todo];report.jsonandreport-with-reruns.jsonboth show the todo with 0 attempts and pass the schema. Before the fold guard,report-with-reruns.jsoncarried the failed attempt and failed the schema (attemptsmust NOT have more than 0 items)test.todo('with a body', async () => {})COLLECTION_ERROR: test.todo() takes a title only; register a test with a body through test.skip(title, fn) or test.fixme(title, fn)[todo], shown above.registerOnedirectly instead of going throughregistrar.Made with Claude Opus 5.5 in Claude Code (T3 Code), on top of Enoch's commit from #1858.