Skip to content

Commit

Permalink
Update typed-rest-client package and provide timeouts for `UseDotNe…
Browse files Browse the repository at this point in the history
…tV2` (#20446)

* Update rest-client package and provide timeouts for UseDotNetV2

* Update UseDotNet version

* Add new requestTimeout input for UseDotNetV2

* Fix validation issue

* Set max timeout to 10 min

---------

Co-authored-by: v-levockina <undefined>
  • Loading branch information
aleksandrlevochkin authored Oct 1, 2024
1 parent 12b7d2a commit 435884d
Show file tree
Hide file tree
Showing 41 changed files with 1,186 additions and 965 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ mockery.registerMock('azure-pipelines-task-lib/task', {
debug: function (message) { return tl.debug(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ mockery.registerMock('azure-pipelines-task-lib/task', {
debug: function (message) { return tl.debug(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
Expand Down
11 changes: 11 additions & 0 deletions Tasks/UseDotNetV2/Tests/versionFetcherGetVersionInfoFailTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ mockery.registerMock('typed-rest-client/HttpClient', {
}
});

mockery.registerMock('azure-pipelines-task-lib/task', {
loc: function (locString, param: string[]) { return tl.loc(locString, param); },
debug: function (message) { return tl.debug(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
});

import { DotNetCoreVersionFetcher } from "../versionfetcher";

const DotNetCoreReleasesIndexUrl: string = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ mockery.registerMock('typed-rest-client/HttpClient', {
}
});

mockery.registerMock('azure-pipelines-task-lib/task', {
loc: function (locString, param: string[]) { return tl.loc(locString, param); },
debug: function (message) { return tl.debug(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
});

import { DotNetCoreVersionFetcher } from "../versionfetcher";

const DotNetCoreReleasesIndexUrl: string = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ mockery.registerMock('azure-pipelines-task-lib/task', {
warning: function (message) { return tl.warning(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ mockery.registerMock('azure-pipelines-task-lib/task', {
warning: function (message) { return tl.warning(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
Expand Down
1 change: 1 addition & 0 deletions Tasks/UseDotNetV2/Tests/versionInstallerTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mockery.registerMock('azure-pipelines-task-lib/task', {
debug: function (message) { return tl.debug(message); },
error: function (errorMessage) { return tl.error(errorMessage); },
getVariable: function (variableName) { return tl.getVariable(variableName); },
getInput: function (inputName, required) { return tl.getInput(inputName, required); },
getHttpProxyConfiguration: function () { return ""; },
getHttpCertConfiguration: function () { return "" },
setResourcePath: function (path) { return; }
Expand Down
Loading

0 comments on commit 435884d

Please sign in to comment.