diff --git a/Directory.Packages.props b/Directory.Packages.props index e4a62861bae..a357295639b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -44,14 +44,14 @@ - - - - - - - - + + + + + + + + diff --git a/TUnit.Engine.Tests/DerivedSkipWithClassDataSourceTests.cs b/TUnit.Engine.Tests/DerivedSkipWithClassDataSourceTests.cs index 83a47291de3..fe4e6040c68 100644 --- a/TUnit.Engine.Tests/DerivedSkipWithClassDataSourceTests.cs +++ b/TUnit.Engine.Tests/DerivedSkipWithClassDataSourceTests.cs @@ -17,7 +17,7 @@ public async Task DerivedSkipWithFailingDataSource_ShouldBeSkipped() await RunTestsWithFilter( "/*/*/DerivedSkipWithFailingClassDataSourceTests/*", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), @@ -31,7 +31,7 @@ public async Task DerivedSkipWithSucceedingDataSource_ShouldBeSkipped() await RunTestsWithFilter( "/*/*/DerivedSkipWithSucceedingClassDataSourceTests/*", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), diff --git a/TUnit.Engine.Tests/DynamicSkipReasonTests.cs b/TUnit.Engine.Tests/DynamicSkipReasonTests.cs index f057a1b8c9a..1f8e6ed8565 100644 --- a/TUnit.Engine.Tests/DynamicSkipReasonTests.cs +++ b/TUnit.Engine.Tests/DynamicSkipReasonTests.cs @@ -11,7 +11,7 @@ public async Task TestSkippedViaSetSkippedMethod_ShouldContainDynamicDeviceName( await RunTestsWithFilter( "/*/*/DynamicSkipReasonTests/TestSkippedViaSetSkippedMethod", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), @@ -25,7 +25,7 @@ public async Task TestSkippedViaGetSkipReasonOverride_ShouldContainDynamicDevice await RunTestsWithFilter( "/*/*/DynamicSkipReasonTests/TestSkippedViaGetSkipReasonOverride", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), diff --git a/TUnit.Engine.Tests/GitHubReporterTests.cs b/TUnit.Engine.Tests/GitHubReporterTests.cs index 44aee46b430..38295421c26 100644 --- a/TUnit.Engine.Tests/GitHubReporterTests.cs +++ b/TUnit.Engine.Tests/GitHubReporterTests.cs @@ -420,9 +420,9 @@ private static TestNodeUpdateMessage CreatePassedTestMessage( string testId, string displayName, string typeName) => CreateTestMessage(testId, displayName, typeName, PassedTestNodeStateProperty.CachedInstance); -#pragma warning disable CS0618 +#pragma warning disable CS0618, MTP0001 // Required to verify TUnit's cancelled-state reporting private static TestNodeUpdateMessage CreateCancelledTestMessage( string testId, string displayName, string typeName) => CreateTestMessage(testId, displayName, typeName, new CancelledTestNodeStateProperty()); -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 } diff --git a/TUnit.Engine.Tests/SkipInHooksTests.cs b/TUnit.Engine.Tests/SkipInHooksTests.cs index aeb1f7bbc9a..de927480427 100644 --- a/TUnit.Engine.Tests/SkipInHooksTests.cs +++ b/TUnit.Engine.Tests/SkipInHooksTests.cs @@ -11,7 +11,7 @@ public async Task SkipInBeforeClassHook_ShouldMarkTestAsSkipped() await RunTestsWithFilter( "/*/*/SkipInBeforeClassHookTests/*", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), @@ -25,7 +25,7 @@ public async Task SkipInBeforeTestHook_ShouldMarkAllTestsAsSkipped() await RunTestsWithFilter( "/*/*/SkipInBeforeTestHookTests/*", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(2), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), diff --git a/TUnit.Engine.Tests/SkipTestExceptionTests.cs b/TUnit.Engine.Tests/SkipTestExceptionTests.cs index 9c51fe4dc98..1bb168c5c9c 100644 --- a/TUnit.Engine.Tests/SkipTestExceptionTests.cs +++ b/TUnit.Engine.Tests/SkipTestExceptionTests.cs @@ -11,11 +11,11 @@ public async Task ThrowingSkipTestException_ShouldMarkAsSkipped() await RunTestsWithFilter( "/*/*/SkipExceptionFixTest/*", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), result => result.ResultSummary.Counters.NotExecuted.ShouldBe(1) ]); } -} \ No newline at end of file +} diff --git a/TUnit.Engine.Tests/SkipTests.cs b/TUnit.Engine.Tests/SkipTests.cs index a400456205a..2ea23f0fadc 100644 --- a/TUnit.Engine.Tests/SkipTests.cs +++ b/TUnit.Engine.Tests/SkipTests.cs @@ -11,7 +11,7 @@ public async Task Test() await RunTestsWithFilter( "/*/*/SkipTests/*", [ - result => result.ResultSummary.Outcome.ShouldBe("Failed"), + result => result.ResultSummary.Outcome.ShouldBe("Completed"), result => result.ResultSummary.Counters.Total.ShouldBe(1), result => result.ResultSummary.Counters.Passed.ShouldBe(0), result => result.ResultSummary.Counters.Failed.ShouldBe(0), diff --git a/TUnit.Engine/Reporters/GitHubReporter.cs b/TUnit.Engine/Reporters/GitHubReporter.cs index f1f816c60ee..390b1adf8dd 100644 --- a/TUnit.Engine/Reporters/GitHubReporter.cs +++ b/TUnit.Engine/Reporters/GitHubReporter.cs @@ -149,9 +149,9 @@ public Task AfterRunAsync(int exitCode, CancellationToken cancellation) case InProgressTestNodeStateProperty: inProgress.Add(kvp); break; -#pragma warning disable CS0618 +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's GitHub cancellation reporting case CancelledTestNodeStateProperty: -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 cancelled.Add(kvp); break; } @@ -502,12 +502,12 @@ private static bool IsFileLocked(IOException exception) private string GetDetails(IProperty? stateProperty, PropertyBag properties) { -#pragma warning disable CS0618 // CancelledTestNodeStateProperty is obsolete +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's GitHub cancellation reporting if (stateProperty is FailedTestNodeStateProperty or ErrorTestNodeStateProperty or TimeoutTestNodeStateProperty or CancelledTestNodeStateProperty) -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 { return $"
{GetError(stateProperty)}
"; } @@ -536,9 +536,9 @@ or TimeoutTestNodeStateProperty ErrorTestNodeStateProperty errorTestNodeStateProperty => GetTruncatedExceptionMessage(TUnitFailedException.Unwrap(errorTestNodeStateProperty.Exception)) ?? "Test failed", TimeoutTestNodeStateProperty timeoutTestNodeStateProperty => timeoutTestNodeStateProperty.Explanation, -#pragma warning disable CS0618 // CancelledTestNodeStateProperty is obsolete +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's GitHub cancellation reporting CancelledTestNodeStateProperty => "Test was cancelled", -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 _ => null }; } @@ -566,9 +566,9 @@ private static string GetStatus(IProperty? stateProperty) { return stateProperty switch { -#pragma warning disable CS0618 // CancelledTestNodeStateProperty is obsolete +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's GitHub cancellation reporting CancelledTestNodeStateProperty => "Cancelled", -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 ErrorTestNodeStateProperty => "Failed", FailedTestNodeStateProperty => "Failed", InProgressTestNodeStateProperty => "In Progress (never finished)", diff --git a/TUnit.Engine/Reporters/Html/HtmlReporter.cs b/TUnit.Engine/Reporters/Html/HtmlReporter.cs index 456483bd670..a2356859dad 100644 --- a/TUnit.Engine/Reporters/Html/HtmlReporter.cs +++ b/TUnit.Engine/Reporters/Html/HtmlReporter.cs @@ -618,9 +618,9 @@ private static (string Status, ReportExceptionData? Exception, string? SkipReaso ErrorTestNodeStateProperty error => ("error", MapException(error.Exception), null), TimeoutTestNodeStateProperty timeout => ("timedOut", MapException(timeout.Exception), null), SkippedTestNodeStateProperty skipped => ("skipped", null, skipped.Explanation), -#pragma warning disable CS0618 +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's HTML cancellation reporting CancelledTestNodeStateProperty => ("cancelled", null, null), -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 InProgressTestNodeStateProperty => ("inProgress", null, null), _ => ("unknown", null, null) }; diff --git a/TUnit.Engine/TUnitMessageBus.cs b/TUnit.Engine/TUnitMessageBus.cs index 9608d8be7e9..56b89e49902 100644 --- a/TUnit.Engine/TUnitMessageBus.cs +++ b/TUnit.Engine/TUnitMessageBus.cs @@ -112,9 +112,9 @@ public ValueTask Skipped(TestContext testContext, string reason) public ValueTask Cancelled(TestContext testContext, DateTimeOffset start) { -#pragma warning disable CS0618 // CancelledTestNodeStateProperty is obsolete - TUnit still needs to report cancelled state for its own reporters +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's own cancellation reporters var testNode = testContext.ToTestNode(new CancelledTestNodeStateProperty()); -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 return new ValueTask(context.MessageBus.PublishAsync(this, CreateUpdateMessage(testContext, testNode))); } diff --git a/TUnit.Engine/Xml/JUnitXmlWriter.cs b/TUnit.Engine/Xml/JUnitXmlWriter.cs index 11f561e7f5d..6eb3e3988fb 100644 --- a/TUnit.Engine/Xml/JUnitXmlWriter.cs +++ b/TUnit.Engine/Xml/JUnitXmlWriter.cs @@ -230,9 +230,9 @@ private static void WriteTestCase(XmlWriter writer, TestNodeUpdateMessage test) WriteTimeoutError(writer, timeout); break; -#pragma warning disable CS0618 // CancelledTestNodeStateProperty is obsolete +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's JUnit cancellation reporting case CancelledTestNodeStateProperty: -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 WriteCancellationError(writer); break; @@ -396,9 +396,9 @@ private static TestSummary CalculateSummary(IEnumerable t break; case ErrorTestNodeStateProperty: case TimeoutTestNodeStateProperty: -#pragma warning disable CS0618 // CancelledTestNodeStateProperty is obsolete +#pragma warning disable CS0618, MTP0001 // Retained for TUnit's JUnit cancellation reporting case CancelledTestNodeStateProperty: -#pragma warning restore CS0618 +#pragma warning restore CS0618, MTP0001 case InProgressTestNodeStateProperty: summary.Errors++; break; diff --git a/examples/CloudShop/CloudShop.Tests/CloudShop.Tests.csproj b/examples/CloudShop/CloudShop.Tests/CloudShop.Tests.csproj index 95ae6fb93a2..22dfc3b61a2 100644 --- a/examples/CloudShop/CloudShop.Tests/CloudShop.Tests.csproj +++ b/examples/CloudShop/CloudShop.Tests/CloudShop.Tests.csproj @@ -22,7 +22,7 @@ - +