Only add StepResult for Tasks, not the Job itself (#2620)

This commit is contained in:
Cameron Booth
2023-06-30 04:17:46 -07:00
committed by GitHub
parent 4ffd081aea
commit d4bbbb8419
2 changed files with 24 additions and 21 deletions

View File

@@ -477,6 +477,8 @@ namespace GitHub.Runner.Worker
PublishStepTelemetry(); PublishStepTelemetry();
if (_record.RecordType == "Task")
{
var stepResult = new StepResult var stepResult = new StepResult
{ {
ExternalID = _record.Id, ExternalID = _record.Id,
@@ -499,6 +501,8 @@ namespace GitHub.Runner.Worker
}); });
Global.StepsResult.Add(stepResult); Global.StepsResult.Add(stepResult);
}
if (Root != this) if (Root != this)
{ {

View File

@@ -821,8 +821,7 @@ namespace GitHub.Runner.Common.Tests.Worker
ec.Complete(); ec.Complete();
// Assert. // Assert.
Assert.Equal(1, ec.Global.StepsResult.Count); Assert.Equal(0, ec.Global.StepsResult.Count);
Assert.Equal(TaskResult.Succeeded, ec.Global.StepsResult.Single().Conclusion);
} }
} }