Skip to content

Commit 488b256

Browse files
committed
Updating Azure DevOps API endpoint versions
1 parent 3c7a073 commit 488b256

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

ReleaseNotes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.3
2+
3+
- [Fix] Updated Azure API endpoints to 5.0 final versions since previews are 404 now.
4+
15
# 1.0.2
26

37
- [Fix] Another fix for test runs without any results

src/AzurePipelines.TestLogger/LoggerQueue.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ internal async Task<int> CreateTestRun(CancellationToken cancellationToken)
142142
{ "startedDate", StartedDate.ToString("yyyy-MM-ddTHH:mm:ss.FFFZ") },
143143
{ "isAutomated", true }
144144
};
145-
string responseString = await _apiClient.SendAsync(HttpMethod.Post, null, "5.0-preview.2", request.ToJson(), cancellationToken).ConfigureAwait(false);
145+
string responseString = await _apiClient.SendAsync(HttpMethod.Post, null, "5.0", request.ToJson(), cancellationToken).ConfigureAwait(false);
146146
using (StringReader reader = new StringReader(responseString))
147147
{
148148
JsonObject response = JsonDeserializer.Deserialize(reader) as JsonObject;
@@ -202,7 +202,7 @@ internal async Task CreateParents(IEnumerable<IGrouping<string, ITestResult>> te
202202
}
203203
return properties.ToJson();
204204
})) + " ]";
205-
string responseString = await _apiClient.SendAsync(HttpMethod.Post, TestRunEndpoint, "5.0-preview.5", request, cancellationToken).ConfigureAwait(false);
205+
string responseString = await _apiClient.SendAsync(HttpMethod.Post, TestRunEndpoint, "5.0", request, cancellationToken).ConfigureAwait(false);
206206
using (StringReader reader = new StringReader(responseString))
207207
{
208208
JsonObject response = JsonDeserializer.Deserialize(reader) as JsonObject;
@@ -236,7 +236,7 @@ private async Task SendTestResults(IEnumerable<IGrouping<string, ITestResult>> t
236236
""subResults"": {subResults}
237237
}}";
238238
})) + " ]";
239-
await _apiClient.SendAsync(new HttpMethod("PATCH"), TestRunEndpoint, "5.0-preview.5", request, cancellationToken).ConfigureAwait(false);
239+
await _apiClient.SendAsync(new HttpMethod("PATCH"), TestRunEndpoint, "5.0", request, cancellationToken).ConfigureAwait(false);
240240
}
241241

242242
private string GetTestResultJson(ITestResult testResult)
@@ -300,15 +300,15 @@ private async Task SendTestsCompleted(CancellationToken cancellationToken)
300300
""startedDate"": ""{x.StartedDate.ToString("yyyy-MM-ddTHH:mm:ss.FFFZ")}"",
301301
""completedDate"": ""{completedDate}""
302302
}}")) + " ]";
303-
await _apiClient.SendAsync(new HttpMethod("PATCH"), TestRunEndpoint, "5.0-preview.5", parentRequest, cancellationToken).ConfigureAwait(false);
303+
await _apiClient.SendAsync(new HttpMethod("PATCH"), TestRunEndpoint, "5.0", parentRequest, cancellationToken).ConfigureAwait(false);
304304

305305
// Mark the overall test run as completed
306306
string testRunRequest = $@"{{
307307
""state"": ""Completed"",
308308
""startedDate"": ""{StartedDate.ToString("yyyy-MM-ddTHH:mm:ss.FFFZ")}"",
309309
""completedDate"": ""{completedDate}""
310310
}}";
311-
await _apiClient.SendAsync(new HttpMethod("PATCH"), $"/{RunId}", "5.0-preview.2", testRunRequest, cancellationToken).ConfigureAwait(false);
311+
await _apiClient.SendAsync(new HttpMethod("PATCH"), $"/{RunId}", "5.0", testRunRequest, cancellationToken).ConfigureAwait(false);
312312
}
313313
}
314314
}

0 commit comments

Comments
 (0)