@@ -49,7 +49,6 @@ public sealed class PublishTestResultsCommand : IWorkerCommand
4949 private bool _publishRunLevelAttachments ;
5050 private TestCaseResult [ ] _testCaseResults ;
5151 private string _testPlanId ;
52- private bool _enableAzureTestPlanFeatureState ;
5352 private bool _publishTestResultsLibFeatureState ;
5453 private bool _triggerCoverageMergeJobFeatureState ;
5554
@@ -161,21 +160,17 @@ private void LoadPublishTestResultsInputs(IExecutionContext context, Dictionary<
161160 _publishRunLevelAttachments = true ;
162161 }
163162
164- if ( _enableAzureTestPlanFeatureState )
163+ string jsonString ;
164+ eventProperties . TryGetValue ( PublishTestResultsEventProperties . ListOfAutomatedTestPoints , out jsonString ) ;
165+ if ( ! string . IsNullOrEmpty ( jsonString ) )
165166 {
166- string jsonString ;
167- eventProperties . TryGetValue ( PublishTestResultsEventProperties . ListOfAutomatedTestPoints , out jsonString ) ;
168- if ( ! string . IsNullOrEmpty ( jsonString ) )
169- {
170- _testCaseResults = Newtonsoft . Json . JsonConvert . DeserializeObject < TestCaseResult [ ] > ( jsonString ) ;
171- }
172-
173- string testPlanId ;
174- eventProperties . TryGetValue ( PublishTestResultsEventProperties . TestPlanId , out testPlanId ) ;
175- if ( ! string . IsNullOrEmpty ( testPlanId ) )
176- {
177- _testPlanId = testPlanId ;
178- }
167+ _testCaseResults = Newtonsoft . Json . JsonConvert . DeserializeObject < TestCaseResult [ ] > ( jsonString ) ;
168+ }
169+ string testPlanId ;
170+ eventProperties . TryGetValue ( PublishTestResultsEventProperties . TestPlanId , out testPlanId ) ;
171+ if ( ! string . IsNullOrEmpty ( testPlanId ) )
172+ {
173+ _testPlanId = testPlanId ;
179174 }
180175 }
181176
@@ -257,7 +252,7 @@ private TestRunContext CreateTestRunContext()
257252
258253 TestRunContext testRunContext ;
259254
260- if ( _enableAzureTestPlanFeatureState && ! string . IsNullOrEmpty ( _testPlanId ) )
255+ if ( ! string . IsNullOrEmpty ( _testPlanId ) )
261256 {
262257 ShallowReference testPlanObject = new ( ) { Id = _testPlanId } ;
263258
@@ -322,7 +317,7 @@ private async Task PublishTestRunDataAsync(string teamProject, TestRunContext te
322317 var publisher = _executionContext . GetHostContext ( ) . GetService < ITestDataPublisher > ( ) ;
323318 publisher . InitializePublisher ( _executionContext , teamProject , connection , _testRunner ) ;
324319
325- if ( _enableAzureTestPlanFeatureState && ! _testCaseResults . IsNullOrEmpty ( ) && ! _testPlanId . IsNullOrEmpty ( ) )
320+ if ( ! _testCaseResults . IsNullOrEmpty ( ) && ! _testPlanId . IsNullOrEmpty ( ) )
326321 {
327322 isTestRunOutcomeFailed = await publisher . PublishAsync ( testRunContext , _testResultFiles , _testCaseResults , GetPublishOptions ( ) , _executionContext . CancellationToken ) ;
328323 }
@@ -444,7 +439,6 @@ private void LoadFeatureFlagState()
444439 var featureFlagService = _executionContext . GetHostContext ( ) . GetService < IFeatureFlagService > ( ) ;
445440 featureFlagService . InitializeFeatureService ( _executionContext , connection ) ;
446441 _publishTestResultsLibFeatureState = featureFlagService . GetFeatureFlagState ( TestResultsConstants . UsePublishTestResultsLibFeatureFlag , TestResultsConstants . TFSServiceInstanceGuid ) ;
447- _enableAzureTestPlanFeatureState = featureFlagService . GetFeatureFlagState ( TestResultsConstants . EnableAzureTestPlanTaskFeatureFlag , TestResultsConstants . TFSServiceInstanceGuid ) ;
448442 _triggerCoverageMergeJobFeatureState = featureFlagService . GetFeatureFlagState ( CodeCoverageConstants . TriggerCoverageMergeJobFF , TestResultsConstants . TFSServiceInstanceGuid ) ;
449443 }
450444 }
0 commit comments