mirror of
https://github.com/actions/runner.git
synced 2025-12-12 15:13:30 +00:00
remove job summary feature flag (#1936)
This commit is contained in:
@@ -275,12 +275,6 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
public void ProcessCommand(IExecutionContext context, string filePath, ContainerInfo container)
|
public void ProcessCommand(IExecutionContext context, string filePath, ContainerInfo container)
|
||||||
{
|
{
|
||||||
if (!context.Global.Variables.GetBoolean("DistributedTask.UploadStepSummary") ?? true)
|
|
||||||
{
|
|
||||||
Trace.Info("Step Summary is disabled; skipping attachment upload");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(filePath) || !File.Exists(filePath))
|
if (String.IsNullOrEmpty(filePath) || !File.Exists(filePath))
|
||||||
{
|
{
|
||||||
Trace.Info($"Step Summary file ({filePath}) does not exist; skipping attachment upload");
|
Trace.Info($"Step Summary file ({filePath}) does not exist; skipping attachment upload");
|
||||||
|
|||||||
@@ -25,23 +25,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
private CreateStepSummaryCommand _createStepCommand;
|
private CreateStepSummaryCommand _createStepCommand;
|
||||||
private ITraceWriter _trace;
|
private ITraceWriter _trace;
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Worker")]
|
|
||||||
public void CreateStepSummaryCommand_FeatureDisabled()
|
|
||||||
{
|
|
||||||
using (var hostContext = Setup(featureFlagState: "false"))
|
|
||||||
{
|
|
||||||
var stepSummaryFile = Path.Combine(_rootDirectory, "feature-off");
|
|
||||||
|
|
||||||
_createStepCommand.ProcessCommand(_executionContext.Object, stepSummaryFile, null);
|
|
||||||
_jobExecutionContext.Complete();
|
|
||||||
|
|
||||||
_jobServerQueue.Verify(x => x.QueueFileUpload(It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>()), Times.Never());
|
|
||||||
Assert.Equal(0, _issues.Count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", "Worker")]
|
[Trait("Category", "Worker")]
|
||||||
@@ -199,7 +182,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
File.WriteAllText(path, contentStr, encoding);
|
File.WriteAllText(path, contentStr, encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TestHostContext Setup([CallerMemberName] string name = "", string featureFlagState = "true")
|
private TestHostContext Setup([CallerMemberName] string name = "")
|
||||||
{
|
{
|
||||||
var hostContext = new TestHostContext(this, name);
|
var hostContext = new TestHostContext(this, name);
|
||||||
|
|
||||||
@@ -241,7 +224,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
_variables = new Variables(hostContext, new Dictionary<string, VariableValue>
|
_variables = new Variables(hostContext, new Dictionary<string, VariableValue>
|
||||||
{
|
{
|
||||||
{ "MySecretName", new VariableValue("My secret value", true) },
|
{ "MySecretName", new VariableValue("My secret value", true) },
|
||||||
{ "DistributedTask.UploadStepSummary", featureFlagState },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Directory for test data
|
// Directory for test data
|
||||||
|
|||||||
Reference in New Issue
Block a user