Skip to content

Port describe.fail registration form and COLLECTION_ERROR for fail on serial groups (upstream #1925) - #2151

Merged
kblok merged 2 commits into
mainfrom
fix/2111-describe-fail-forms
Nov 23, 2026
Merged

kblok merged 2 commits into
mainfrom
fix/2111-describe-fail-forms

Conversation

@kblok

@kblok kblok commented Nov 23, 2026

Copy link
Copy Markdown
Member

What

Ports the rest of upstream e2e-inc/e2e#1925 (c30354f): the describe.fail(title, fn) registration form and the registry's collection-time checks on fail.

  • [DescribeFail] (NUnit, class-level) marks every test of a fixture expected to fail with the default reason; it takes no reason, as describe.fail takes no fail option. A reason is [Property("E2E.Fail", reason)], as before.
  • A filtered run now refuses at collection (COLLECTION_ERROR): a fail that is not a reason string (got 1), fail on or inside a [Serial] fixture, and a [Serial] fixture inside a marked fixture. An unfiltered run does not collect, so the member refuses itself with the same error (was INVALID_ARGUMENT).
  • The test.Fail(...) outside-a-body message now names [DescribeFail], as upstream's names describe.fail.

Value: tests are marked as groups the way upstream users write them, and misuse fails early, not at test time.

Closes #2111

Upstream parity

Verdict: complete, with the justified exceptions below. Upstream: tester-army/e2e c30354f.

Upstream Port
describe.fail / describe(..., {fail}) in registry.ts DescribeFailAttribute, [Property("E2E.Fail")] (existing)
validateFailOption ExpectedFailureMarks.FailOptionError
serial rules in validateDescribeOptions ExpectedFailureMarks.SerialFailError, RunSelection.FailErrorOf, thrown in HostTestFilters.Collect
markRunningTestExpectedToFail message updated
resolveOptions fail merge already ported
docs (reference/test.mdx, writing-tests.md) nunit.mdx, writing-tests-nunit.md, SKILL.md, COMPATIBILITY.md, API page for DescribeFailAttribute (written by hand: npm run api needs the net11 SDK, absent here)

Port-only symbols: DescribeFailAttribute (.NET attribute shape for a call form), DiscoveredTest.FailError and RunSelection.FailErrorOf (the port has no collector; discovery is the registration).

Upstream tests and local match

  • expected-failure.test.ts "marks every test in a describe.fail group, each judged on its own": TestFailTests.Marks_every_test_in_a_describe_fail_group_each_judged_on_its_own, fixture now uses [DescribeFail].
  • registry.test.ts "marks a group by describe.fail(title, fn) or the fail option, and checks both": Partial_marks_a_group_... (adds the bad-value check).
  • registry.test.ts "refuses fail on, inside, or around a serial group": Partial_refuses_fail_on_inside_or_around_a_serial_group (collection and unfiltered run).
  • registry.test.ts "rejects test.fail(condition) outside a test body": message assertion added in TestFailTests.
  • select.test.ts resolveOptions fail test: ResolveOptionsTests (unchanged, already ported).
  • sdk-types.ts: type-level checks, no counterpart.

Not ported

  • describe.fail nested inside a serial group (nested classes are not members of the enclosing serial group); fail: false as a value; describe.fail given options/tags/hidden keys and the "takes no fail option" error (the attribute takes none). All need a collector the port lacks; recorded in COMPATIBILITY.md. No separate issue: they have no .NET form to implement.
  • xUnit v3 and TUnit have no fail mark at all (pre-existing).

Testing

Registration tests pass under net10. Tests needing a Chromium install (TestFailTests verdict tests) cannot run in this sandbox; CI runs them. No agent behavior changed, so no real-model run.


Generated by Claude Code

…_ERROR for fail on serial groups (upstream #1925)

Closes #2111

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e23PdHSJ5LMzn84z25u
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6a03bb1 and 21a1a42.

Files selected for processing: 15

  • COMPATIBILITY.md
  • docs-site/public/api/E2E.NUnit.DescribeFailAttribute.html
  • docs-site/src/content/docs/api/E2E.NUnit/DescribeFailAttribute.md
  • docs-site/src/content/docs/api/E2E.NUnit/index.md
  • docs-site/src/content/docs/testing-frameworks/nunit.mdx
  • skills/e2e-dotnet/SKILL.md
  • skills/e2e-dotnet/references/writing-tests-nunit.md
  • src/E2E.NUnit/DescribeFailAttribute.cs
  • src/E2E.NUnit/E2ETest.cs
  • src/E2E.NUnit/RunSelection.cs
  • src/E2E/Internal/ExpectedFailureInfo.cs
  • src/E2E/Run/HostTestFilters.cs
  • tests/E2E.NUnit.Tests/ExpectedFailure/ExpectedFailureFixtures.cs
  • tests/E2E.NUnit.Tests/ExpectedFailure/TestFailTests.cs
  • tests/E2E.NUnit.Tests/Registry/RegistrationTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…l-forms

# Conflicts:
#	docs-site/src/content/docs/testing-frameworks/nunit.mdx
#	skills/e2e-dotnet/SKILL.md
#	skills/e2e-dotnet/references/writing-tests-nunit.md
@kblok
kblok merged commit 84f844d into main Nov 23, 2026
5 checks passed
@kblok
kblok deleted the fix/2111-describe-fail-forms branch November 23, 2026 11:17
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.

Port describe.fail registration forms and COLLECTION_ERROR for fail on serial groups (upstream #1925)

2 participants