Document RepeatAttribute threshold features (NUnit 5, issue #5220)#1187
Merged
Conversation
Add RequiredPassPercentage (int, 1-100) and StopWhenOverallResultDetermined (bool) to the repeat attribute docs, with version notes, updated properties table, two new examples, and expanded Notes section. The new snippet regions are guarded with #if NUNIT_REPEAT_THRESHOLD until the matching NUnit package version is published — remove the guard and add the define constant to the csproj at that point. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the NUnit documentation and snippet examples to cover new RepeatAttribute threshold-based execution features introduced for NUnit 5, including pass-percentage evaluation and optional early termination once the overall outcome is known.
Changes:
- Documented
RequiredPassPercentageandStopWhenOverallResultDeterminedon theRepeatattribute page, including new usage examples and expanded Notes. - Added two new snippet regions demonstrating pass-threshold behavior and early-stop behavior.
- Updated the snippets project’s NUnit/NUnit3TestAdapter package versions to newer pre-release builds.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| docs/articles/nunit/writing-tests/attributes/repeat.md | Adds documentation for new RepeatAttribute threshold properties and new example sections. |
| docs/snippets/Snippets.NUnit/Attributes/RepeatAttributeExample.cs | Adds new snippet regions for pass-threshold and early-stop examples (currently guarded by #if). |
| docs/snippets/Snippets.NUnit/Snippets.NUnit.csproj | Updates NUnit and NUnit3TestAdapter package references for the snippets project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 3, 2026
Document RepeatAttribute threshold features (NUnit 5, issue #5220) 8065c48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the two new
RepeatAttributeproperties added in NUnit 5 for threshold-based test evaluation (issue nunit/nunit#5220):RequiredPassPercentage(int, 1–100, default 100) — the test passes if at least this percentage of runs succeed. Useful for non-deterministic systems (LLM tests, flaky integrations) where some variation is acceptable.StopWhenOverallResultDetermined(bool, default false) — when set alongside a threshold below 100%, stops iterating as soon as the final outcome is guaranteed (either the threshold is already met, or can no longer be reached).Changes
docs/articles/nunit/writing-tests/attributes/repeat.md— updated properties table, added NUnit 5.0 version notes, two new example sections, and expanded Notes.docs/snippets/Snippets.NUnit/Attributes/RepeatAttributeExample.cs— addedRepeatWithPassThresholdExampleandRepeatWithStopWhenDeterminedExampleregions.Draft status
The new snippet regions are guarded with
#if NUNIT_REPEAT_THRESHOLDbecause the NuGet package containing the implementation has not been published yet. Before merging:NUnitpackage reference indocs/snippets/Snippets.NUnit/Snippets.NUnit.csprojto that version.<DefineConstants>NUNIT_REPEAT_THRESHOLD</DefineConstants>to the same csproj (or remove the#ifguard entirely once the package ref is updated).RepeatAttributeExample.cs.Test plan
#ifguard)RequiredPassPercentageandStopWhenOverallResultDetermined#ifguard and update package ref before merge🤖 Generated with Claude Code