diff --git a/src/Agent.Sdk/Knob/AgentKnobs.cs b/src/Agent.Sdk/Knob/AgentKnobs.cs index ad832c4d1d..46b78d383d 100644 --- a/src/Agent.Sdk/Knob/AgentKnobs.cs +++ b/src/Agent.Sdk/Knob/AgentKnobs.cs @@ -614,6 +614,13 @@ public class AgentKnobs new EnvironmentKnobSource("AZP_ENABLE_RESOURCE_UTILIZATION_WARNINGS"), new BuiltInDefaultKnobSource("false")); + public static readonly Knob EnableAzureTestPlanFeatureState = new Knob( + nameof(EnableAzureTestPlanFeatureState), + "If true, enables manual test point information linkage to automated test results.", + new RuntimeKnobSource("AZP_AGENT_ENABLE_AZURE_TEST_PLAN_FEATURE_STATE"), + new EnvironmentKnobSource("AZP_AGENT_ENABLE_AZURE_TEST_PLAN_FEATURE_STATE"), + new BuiltInDefaultKnobSource("false")); + public static readonly Knob ForceCreateTasksDirectory = new Knob( nameof(ForceCreateTasksDirectory), "Forces the agent to create _tasks folder for tasks.", diff --git a/src/Agent.Worker/TestResults/ResultsCommandExtension.cs b/src/Agent.Worker/TestResults/ResultsCommandExtension.cs index 2aa8e5cfeb..520c4c40ca 100644 --- a/src/Agent.Worker/TestResults/ResultsCommandExtension.cs +++ b/src/Agent.Worker/TestResults/ResultsCommandExtension.cs @@ -18,6 +18,7 @@ using Microsoft.VisualStudio.Services.Agent.Worker.CodeCoverage; using Microsoft.VisualStudio.Services.WebApi; using Microsoft.VisualStudio.Services.WebPlatform; +using Agent.Sdk.Knob; namespace Microsoft.VisualStudio.Services.Agent.Worker.TestResults { @@ -444,7 +445,10 @@ private void LoadFeatureFlagState() var featureFlagService = _executionContext.GetHostContext().GetService(); featureFlagService.InitializeFeatureService(_executionContext, connection); _publishTestResultsLibFeatureState = featureFlagService.GetFeatureFlagState(TestResultsConstants.UsePublishTestResultsLibFeatureFlag, TestResultsConstants.TFSServiceInstanceGuid); - _enableAzureTestPlanFeatureState = featureFlagService.GetFeatureFlagState(TestResultsConstants.EnableAzureTestPlanTaskFeatureFlag, TestResultsConstants.TFSServiceInstanceGuid); + if (AgentKnobs.EnableAzureTestPlanFeatureState.GetValue(_executionContext).AsBoolean()) + { + _enableAzureTestPlanFeatureState = featureFlagService.GetFeatureFlagState(TestResultsConstants.EnableAzureTestPlanTaskFeatureFlag, TestResultsConstants.TFSServiceInstanceGuid); + } _triggerCoverageMergeJobFeatureState = featureFlagService.GetFeatureFlagState(CodeCoverageConstants.TriggerCoverageMergeJobFF, TestResultsConstants.TFSServiceInstanceGuid); } }