You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may not be considered a bug, so close if it won't be fixed.
Describe the bug
If a test that has previously been reported, is reported again with a new status, it is counted as another test, and doesn't just update the existing one.
Steps To Reproduce
Test A > Report Success
Test A > Report Failure (maybe a hook that ran after it failed, and you need to attach that failure to something?)
// See https://aka.ms/new-console-template for more informationusingMicrosoft.Testing.Platform.Builder;usingMicrosoft.Testing.Platform.Capabilities;usingMicrosoft.Testing.Platform.Capabilities.TestFramework;usingMicrosoft.Testing.Platform.Extensions.Messages;usingMicrosoft.Testing.Platform.Extensions.TestFramework;usingMicrosoft.Testing.Platform.TestHost;varbuilder=awaitTestApplication.CreateBuilderAsync(args);builder.RegisterTestFramework(_ =>newTestFrameworkCapabilities(),(_,_)=>newDummyAdapter());varapp=awaitbuilder.BuildAsync();returnawaitapp.RunAsync();internalclassDummyAdapter:ITestFramework,IDataProducer{publicstringUid=>nameof(DummyAdapter);publicstringVersion=>string.Empty;publicstringDisplayName=>string.Empty;publicstringDescription=>string.Empty;publicType[]DataTypesProduced=>[typeof(TestNodeUpdateMessage)];publicTask<CloseTestSessionResult>CloseTestSessionAsync(CloseTestSessionContextcontext)=>Task.FromResult(newCloseTestSessionResult{IsSuccess=true});publicTask<CreateTestSessionResult>CreateTestSessionAsync(CreateTestSessionContextcontext)=>Task.FromResult(newCreateTestSessionResult{IsSuccess=true});publicTaskExecuteRequestAsync(ExecuteRequestContextcontext){context.MessageBus.PublishAsync(this,newTestNodeUpdateMessage(newSessionUid("1"),newTestNode{Uid="2",DisplayName="Blah",Properties=newPropertyBag(PassedTestNodeStateProperty.CachedInstance)}));context.MessageBus.PublishAsync(this,newTestNodeUpdateMessage(newSessionUid("1"),newTestNode{Uid="2",DisplayName="Blah",Properties=newPropertyBag(newTimeoutTestNodeStateProperty(newException()))}));context.Complete();returnTask.CompletedTask;}publicTask<bool>IsEnabledAsync()=>Task.FromResult(true);}internalclassCapabilities:ITestFrameworkCapabilities{IReadOnlyCollection<ITestFrameworkCapability>ICapabilities<ITestFrameworkCapability>.Capabilities=>Array.Empty<ITestFrameworkCapability>();}
Expected behavior
Previously reported status with same test Uid is overwritten with new status
Actual behavior
Updated status is counted as a new test
Test run summary: Failed!
total: 2
failed: 1
succeeded: 1
skipped: 0
duration: 71ms
The text was updated successfully, but these errors were encountered:
The current behavior seems correct, the result of the test is the final state, overwriting it would likely force us to rewrite some or lot of the code to work on list of events, rather than aggregating the momentary state. We would also have hard time knowing when the final state arrived, or if there will be more updates in the future.
To me the test should report one single final result when it is done running and done tearing down. If more errors happen later, additional error should be reported to the scope that contains it, or to the whole run.
The behavior is also provided to somehow match VSTest behavior when a test is not expanded/unfolded and so multiple results are possible for the same "test case".
This may not be considered a bug, so close if it won't be fixed.
Describe the bug
If a test that has previously been reported, is reported again with a new status, it is counted as another test, and doesn't just update the existing one.
Steps To Reproduce
Test A > Report Success
Test A > Report Failure (maybe a hook that ran after it failed, and you need to attach that failure to something?)
Expected behavior
Previously reported status with same test Uid is overwritten with new status
Actual behavior
Updated status is counted as a new test
The text was updated successfully, but these errors were encountered: