Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add agent knob for EnableAzureTestPlanTaskFlow #4954

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,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.",
Expand Down
6 changes: 5 additions & 1 deletion src/Agent.Worker/TestResults/ResultsCommandExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -444,7 +445,10 @@ private void LoadFeatureFlagState()
var featureFlagService = _executionContext.GetHostContext().GetService<IFeatureFlagService>();
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);
}
}
Expand Down
Loading