Upgrading from 4.x
Version 5.0 has one breaking change: the tool needs the .NET 8 or .NET 10 runtime. Report files are still written directly to --results-directory, as in 4.x, so CI steps that publish them do not change.
Checklist
- Make sure the machine that runs
test-rerunhas the .NET 8 or .NET 10 runtime. - If you use the
-net9or-dotnet9Docker images, switch to-net8or-net10. - If you added extra quotes or backslashes to arguments so they survived the tool, remove them.
- Check that
--loglevelis one ofDebug,Verbose,Information,WarningorError.
Breaking change
The tool needs .NET 8 or .NET 10
The tool now targets net8.0 and net10.0. .NET 6 and .NET 9 are out of support, so it no longer runs on a machine whose only runtime is .NET 6 or .NET 9. Install the .NET 8 or .NET 10 runtime next to it. Projects under test can still target net6.0, net9.0 or older frameworks, as long as their SDK and runtime are installed.
The <version>-net9 and <version>-dotnet9 Docker images are no longer published. Use <version>-net8 or <version>-net10. See Docker.
Behaviour changes
These are not breaking for documented usage, but you may notice them.
- Arguments are passed as they are. The tool hands each argument to
dotnet testas a separate argument, and the runtime quotes it for the current OS. Values with spaces, such as a--filteror inline run settings after--, no longer need extra escaping. If you added\"or nested quotes to work around 4.x, remove them. - Unknown
--loglevelvalues are an error. 4.x silently fell back to the default. --rerunFailedThresholdapplies to the first run only. In 4.x it was checked again after each rerun, where the failure percentage is always high because only failed tests run, so later reruns were often skipped.--delayonly waits before a rerun. It no longer waits when all tests passed or when no rerun is needed.- Failures are detected from the exit code and the TRX files. Reruns now work when
dotnet testprints its output in another language. Atrxlogger is always added if your--loggeroptions have none. - Several target frameworks. An attempt fails if any target framework failed, not only the last one. Reruns still run every target framework of the project.
- Long filters are split. A rerun filter longer than 8000 characters is run as several
dotnet testcalls within the same attempt, to stay under the Windows command-line limit. - Docker images are based on the .NET SDK, so
dotnet testworks inside them. Images up to5.0.0-alpha.0could not run tests. See Docker.
New in 5.0
--generateTestCommandprints adotnet testcommand that runs only the tests that still fail at the end. See Reproducing failed tests.