Skip to content

Commit a4da0d8

Browse files
committed
Sends started dates when marking as completed
1 parent 13d3954 commit a4da0d8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

ReleaseNotes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.4.7
2+
3+
- [Fix] Sends start dates when marking as completed so they don't get reset
4+
15
# 0.4.6
26

37
- [Feature] Sets start dates

src/AzurePipelines.TestLogger/LoggerQueue.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,18 +289,21 @@ private string GetTestResultJson(ITestResult testResult)
289289
private async Task SendTestsCompleted(CancellationToken cancellationToken)
290290
{
291291
string completedDate = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.FFFZ");
292+
292293
// Mark all parents as completed
293294
string parentRequest = "[ " + string.Join(", ", Parents.Values.Select(x =>
294295
$@"{{
295296
""id"": { x.Id },
296-
""state"": ""Completed"",
297+
""state"": ""Completed"",
298+
""startedDate"": ""{ x.StartedDate.ToString("yyyy-MM-ddTHH:mm:ss.FFFZ") }"",
297299
""completedDate"": ""{ completedDate }""
298300
}}")) + " ]";
299301
await _apiClient.SendAsync(new HttpMethod("PATCH"), TestRunEndpoint, "5.0-preview.5", parentRequest, cancellationToken);
300302

301303
// Mark the overall test run as completed
302304
string testRunRequest = $@"{{
303305
""state"": ""Completed"",
306+
""startedDate"": ""{ StartedDate.ToString("yyyy-MM-ddTHH:mm:ss.FFFZ") }"",
304307
""completedDate"": ""{ completedDate }""
305308
}}";
306309
await _apiClient.SendAsync(new HttpMethod("PATCH"), $"/{RunId}", "5.0-preview.2", testRunRequest, cancellationToken);

0 commit comments

Comments
 (0)