|
1 | 1 | --- |
2 | 2 | title: What's New in v3? |
3 | | -title-version: 2025 July 30 |
| 3 | +title-version: 2025 August 14 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | This guide aims to be a comprehensive list of the new features added to v3, written for existing developers who are using v2. |
@@ -232,7 +232,38 @@ In v3, while using the default culture of your PC remains the default behavior, |
232 | 232 |
|
233 | 233 | The randomization algorithm for test collections and test cases is no longer based on pseudo-random number generation. This allows the randomization order to remain stable across most changes while remaining unpredictable. |
234 | 234 |
|
235 | | -The randomization seed remains available for some edge cases, but mostly is unused now. |
| 235 | +As of v3 version 3.0.1, the test assembly unique ID (for v3 tests) is now printed in the results output, like this example shows: |
| 236 | + |
| 237 | +```shell |
| 238 | +$ .\src\xunit.v3.assert.tests\bin\Release\net8.0\xunit.v3.assert.netcore.tests.exe |
| 239 | +xUnit.net v3 In-Process Runner v3.0.1-pre.31-dev+bc5da59e79 (64-bit .NET 8.0.18) |
| 240 | + Discovering: xunit.v3.assert.netcore.tests (method display = ClassAndMethod, method display options = None) |
| 241 | + Discovered: xunit.v3.assert.netcore.tests (1290 test cases to be run) |
| 242 | + Starting: xunit.v3.assert.netcore.tests (parallel test collections = on [32 threads], stop on fail = off, explicit = off, seed = 539400576, culture = invariant) |
| 243 | + Finished: xunit.v3.assert.netcore.tests |
| 244 | +=== TEST EXECUTION SUMMARY === |
| 245 | + xunit.v3.assert.netcore.tests Total: 1530, Errors: 0, Failed: 0, Skipped: 0, Not Run: 0, Time: 0.123s, ID: '8b21b008c584f88489008494f43f8683792002cd3e144875b8b3ba37c9836e4e' |
| 246 | +``` |
| 247 | + |
| 248 | +The test assembly unique ID is the basis for the stable randomization algorithm, and is normally auto-generated based on the file path to the test assembly on disk. This means running the tests from the same location should re-run them in the same (random) order, but running a test assembly from a different location will generated a different unique ID, and thus run the tests in a different (random) order. The most common situation where you might see this is running tests locally vs. running them in a CI build environment. |
| 249 | + |
| 250 | +With tests linked against v3 3.0.1 or later, you can create a file on disk to override the test assembly unique ID, which can be useful when trying to reproduce an order-related test failure in a separate environment. To do this, place a file on disk next to the test assembly, with the same name but the extension of `.uniqueid`. For example: |
| 251 | + |
| 252 | +```shell |
| 253 | +$ cat .\src\xunit.v3.assert.tests\bin\Release\net8.0\xunit.v3.assert.netcore.tests.uniqueid |
| 254 | +abc123 |
| 255 | + |
| 256 | +$ .\src\xunit.v3.assert.tests\bin\Release\net8.0\xunit.v3.assert.netcore.tests.exe |
| 257 | +xUnit.net v3 In-Process Runner v3.0.1-pre.31-dev+bc5da59e79 (64-bit .NET 8.0.18) |
| 258 | + Discovering: xunit.v3.assert.netcore.tests (method display = ClassAndMethod, method display options = None) |
| 259 | + Discovered: xunit.v3.assert.netcore.tests (1290 test cases to be run) |
| 260 | + Starting: xunit.v3.assert.netcore.tests (parallel test collections = on [32 threads], stop on fail = off, explicit = off, seed = 539400576, culture = invariant) |
| 261 | + Finished: xunit.v3.assert.netcore.tests |
| 262 | +=== TEST EXECUTION SUMMARY === |
| 263 | + xunit.v3.assert.netcore.tests Total: 1530, Errors: 0, Failed: 0, Skipped: 0, Not Run: 0, Time: 0.124s, ID: 'abc123' |
| 264 | +``` |
| 265 | + |
| 266 | +_Note: The randomization seed from earlier versions of v3 remains available for some edge cases, but mostly is unused now._ |
236 | 267 |
|
237 | 268 | ### Updated theory data serialization support |
238 | 269 |
|
|
0 commit comments