Obsolete CancelledTestNodeStateProperty#6828
Conversation
…categories Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
src/Platform/Microsoft.Testing.Platform/Messages/TestNodeProperties.Categories.cs
Show resolved
Hide resolved
test/UnitTests/Microsoft.Testing.Platform.UnitTests/Services/TestApplicationResultTests.cs
Show resolved
Hide resolved
Youssef1313
left a comment
There was a problem hiding this comment.
@copilot Any occurrence of CancelledTestNodeStateProperty in the codebase should be surrounded by #pragma warning disable CS0618 // Type or member is obsolete and #pragma warning restore CS0618 // Type or member is obsolete
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
…y usages Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Done. Added |
Evangelink
left a comment
There was a problem hiding this comment.
I am not opposed to that obsolescence but I am curious as to why? The original design was to say we have 2 parent states success and failure and sub-states from these states allowing to define more precisely the kind of issue so that clients (e.g. Console, IDE...) can make specialized display.
|
I don't see any possible meaningful usage of CancelledTestNodeStateProperty. Happy to discuss if you have examples though. |
Obsolete CancelledTestNodeStateProperty - COMPLETE ✅
Based on the issue discussion and agent instructions, the
CancelledTestNodeStatePropertyshould not have been introduced. When cancellation is requested, test frameworks should throwOperationCanceledExceptionusing the cancellation token passed by Microsoft.Testing.Platform, rather than reporting a cancelled test state.All changes completed:
[Obsolete]attribute toCancelledTestNodeStatePropertyclass inTestNodeProperties.cswith clear guidance messageCancelledTestNodeStatePropertyinWellKnownTestNodeTestRunOutcomeFailedPropertiesandWellKnownTestNodeTestRunOutcomePropertiesarrays with suppressed obsolete warningsCancelledTestNodeStatePropertyin the codebaseFiles updated with pragma warning suppressions:
TestNodeProperties.Categories.cs(2 occurrences)HangDumpActivityIndicator.cs(1 occurrence)MSBuildConsumer.cs(1 occurrence)TerminalOutputDevice.cs(1 occurrence)BrowserOutputDevice.cs(1 occurrence)DotnetTestDataConsumer.cs(1 occurrence)Json.cs(1 occurrence)PerRequestServerDataConsumerService.cs(1 occurrence)SerializerUtilities.cs(1 occurrence)AzureDevOpsReporter.cs(1 occurrence)TestExecutionContext.cs(1 occurrence - MSTest.Engine)TestApplicationResultTests.cs(1 occurrence)TestNodePropertiesTests.cs(already has file-level suppression)Impact:
CancelledTestNodeStatePropertyis marked as obsolete to discourage its useSecurity Summary:
No security vulnerabilities introduced or identified in the changes.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.