Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DotnetCoreInstaller] Fetching download urls from releases.json file #7434

Merged
merged 11 commits into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@
"loc.input.label.packageType": "Package to install",
"loc.input.help.packageType": "Please select whether to install only runtime or full SDK.",
"loc.input.label.version": "Version",
"loc.input.help.version": "Specify exact version of .NET Core SDK or runtime to install.<br/><br/>Examples:<br/>1. To install 1.0.4 SDK, use 1.0.4<br/>2. To install 1.1.2 runtime, use 1.1.2<br/>2. To install 2.0 preview 2 runtime, use 2.0.0-preview2-25407-01<br/><br/>For getting more details about exact version, refer [here](https://github.com/dotnet/core/blob/master/release-notes/releases.csv)",
"loc.input.help.version": "Specify exact version of .NET Core SDK or runtime to install.<br/><br/>Examples:<br/>1. To install 1.0.4 SDK, use 1.0.4<br/>2. To install 1.1.2 runtime, use 1.1.2<br/>2. To install 2.0 preview 2 runtime, use 2.0.0-preview2-25407-01<br/><br/>For getting more details about exact version of runtime (, refer [here](https://github.com/dotnet/core/blob/master/release-notes/releases.json)",
"loc.messages.ToolFailed": "Tool install failed: %s",
"loc.messages.ImplicitVersionNotSupported": "Version should be a valid and explicit version: %s",
"loc.messages.PrimaryUrlDownloadFailed": "Failed to download .NET Core package using primary URL. Error: %s.",
"loc.messages.LegacyUrlDownloadFailed": "Failed to download .NET Core package using legacy URL as well. Error: %s.",
"loc.messages.DownloadFailed": "Failed to download .NET Core package. Please ensure that .NET Core %s of version %s exists. Check out: https://github.com/dotnet/core/blob/master/release-notes/releases.csv",
"loc.messages.getDownloadUrlsFailed": "Failed to get download urls. Error: %s.",
"loc.messages.getMachinePlatformFailed": "Failed to get machine platform details. Error: %s.",
"loc.messages.UsingCachedTool": "Cached copy of .NET Core exists. No need to install afresh. Cached tool location: %s.",
"loc.messages.CheckingToolCache": "Checking if a cached copy exists for this version...",
"loc.messages.InstallingAfresh": "Cache does not contains this particular .NET Core. Will be downloaded and installed.",
"loc.messages.GettingDownloadUrls": "Getting URLs to download .NET Core %s version: %s.",
"loc.messages.NullDownloadUrls": "Could not construct download Urls. Please ensure that specified version is valid.",
"loc.messages.DownloadingPrimaryUrl": "Downloading .NET Core package from primary URL: %s",
"loc.messages.DownloadingSecondaryUrl": "Downloading .NET Core package from legacy URL: %s",
"loc.messages.GettingDownloadUrl": "Getting URL to download .NET Core %s version: %s.",
"loc.messages.CouldNotDetectPlatform": "Could not detect the machine's OS",
"loc.messages.NullDownloadUrls": "Could not construct download Url. Please ensure that specified version %s is valid.",
"loc.messages.DownloadingUrl": "Downloading .NET Core package from URL: %s",
"loc.messages.ExtractingPackage": "Extracting downloaded package %s.",
"loc.messages.CachingTool": "Caching this installed tool.",
"loc.messages.SuccessfullyInstalled": "Successfully installed .NET Core %s version %s.",
"loc.messages.ToolToInstall": "Tool to install: .NET Core %s version %s."
"loc.messages.ToolToInstall": "Tool to install: .NET Core %s version %s.",
"loc.messages.PrimaryPlatform": "Detected platform (Primary): %s",
"loc.messages.LegacyPlatform": "Detected platform (Legacy): %s",
"loc.messages.VersionNotFound": "Could not fetch download information for version %s. Please check if the version specified is correct. You can refer https://github.com/dotnet/core/blob/master/release-notes/releases.json",
"loc.messages.CouldNotDownload": "Could not download installation package from this URL: %s Error: %s",
"loc.messages.FailedToDownloadPackage": "Failed to download package for installation"
}
18 changes: 7 additions & 11 deletions Tasks/DotNetCoreInstallerV0/Tests/InstallNix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,28 @@ process.env["AGENT_TEMPDIRECTORY"] = "/agent/_temp";

let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
"exec": {
"/somedir/currdir/externals/install-dotnet.sh --version 1.0.4 --dry-run": {
"code": process.env["__get_dlurls_failed__"] === "true" ? -1 : 0,
"stdout": process.env["__get_dlurls_failed__"] === "true" ? "" : "dotnet-install: Payload URLs:" + os.EOL + "dotnet-install: Payload URL: https://primary-url" + os.EOL + "dotnet-install: Legacy payload URL: https://legacy-url" + os.EOL + "dotnet-install: Repeatable invocation:",
"stderr": process.env["__get_dlurls_failed__"] === "true" ? "install-script failed to get donwload urls" : ""
},
"/somedir/currdir/externals/install-dotnet.sh --version 1.0.4 --dry-run --shared-runtime": {
"somedir/currdir/externals/get-os-distro.sh": {
"code": 0,
"stdout": "dotnet-install: Payload URLs:" + os.EOL + "dotnet-install: Payload URL: https://primary-runtime-url" + os.EOL + "dotnet-install: Legacy payload URL: https://legacy-runtime-url" + os.EOL + "dotnet-install: Repeatable invocation:"
"stdout": "Primary: linux" + os.EOL,
}
},
"osType": {
"osType": "Linux"
},
"which": {
"/somedir/currdir/externals/install-dotnet.sh": "/somedir/currdir/externals/install-dotnet.sh"
"somedir/currdir/externals/get-os-distro.sh": "somedir/currdir/externals/get-os-distro.sh"
},
"checkPath": {
"/somedir/currdir/externals/install-dotnet.sh": true
"somedir/currdir/externals/get-os-distro.sh": true
}
};

var ut = require('../utilities');
tr.registerMock('./utilities', {
getCurrentDir : function() {
getCurrentDir: function () {
return "/somedir/currdir";
},
setFileAttribute: function(file, mode) {
setFileAttribute: function (file, mode) {
console.log("Changing attribute for file " + file + " to " + mode);
}
});
Expand All @@ -50,4 +45,5 @@ tr.setAnswers(a);

tr.registerMock('vsts-task-lib/toolrunner', require('vsts-task-lib/mock-toolrunner'));
tr.registerMock('vsts-task-tool-lib/tool', require('./mock_node_modules/tool'));
tr.registerMock('./releasesfetcher', require("./mock_node_modules/releasesfetcher"));
tr.run();
1 change: 1 addition & 0 deletions Tasks/DotNetCoreInstallerV0/Tests/InstallWindows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ tr.setAnswers(a);

tr.registerMock('vsts-task-lib/toolrunner', require('vsts-task-lib/mock-toolrunner'));
tr.registerMock('vsts-task-tool-lib/tool', require('./mock_node_modules/tool'));
tr.registerMock('./releasesfetcher', require("./mock_node_modules/releasesfetcher"));
tr.run();
8 changes: 4 additions & 4 deletions Tasks/DotNetCoreInstallerV0/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('DotNetCoreInstaller', function() {
assert(tr.stdout.indexOf("Checking local tool for dncs and version 1.0.4") > -1, "should check for local cached tool");
assert(tr.stdout.indexOf("loc_mock_InstallingAfresh") > -1, "should install fresh if cache miss");
assert(tr.stdout.indexOf("Downloading tool from https://primary-url") > -1, "should download from correct url");
assert(tr.stdout.indexOf("Extracting zip archieve from C:\\agent\\_temp\\someArchieve") > -1, "Should extract downloaded archieve corectly");
assert(tr.stdout.indexOf("Extracting zip archive from C:\\agent\\_temp\\someArchive.zip") > -1, "Should extract downloaded archive corectly");
assert(tr.stdout.indexOf("Caching dir C:\\agent\\_temp\\someDir for tool dncs version 1.0.4") > -1, "should cache correctly");
assert(tr.stdout.indexOf("loc_mock_SuccessfullyInstalled sdk 1.0.4") > -1, "should print installed tool info");
assert(tr.stdout.indexOf("prepending path: C:\\agent\\_tools\\cacheDir") > -1, "should pre-prend to PATH");
Expand All @@ -60,7 +60,7 @@ describe('DotNetCoreInstaller', function() {
assert(tr.stdout.indexOf("Checking local tool for dncr and version 1.0.4") > -1, "should check for local cached tool");
assert(tr.stdout.indexOf("loc_mock_InstallingAfresh") > -1, "should install fresh if cache miss");
assert(tr.stdout.indexOf("Downloading tool from https://primary-runtime-url") > -1, "should download from correct url");
assert(tr.stdout.indexOf("Extracting zip archieve from C:\\agent\\_temp\\someArchieve") > -1, "Should extract downloaded archieve corectly");
assert(tr.stdout.indexOf("Extracting zip archive from C:\\agent\\_temp\\someArchive.zip") > -1, "Should extract downloaded archive corectly");
assert(tr.stdout.indexOf("Caching dir C:\\agent\\_temp\\someDir for tool dncr version 1.0.4") > -1, "should cache correctly");
assert(tr.stdout.indexOf("loc_mock_SuccessfullyInstalled runtime 1.0.4") > -1, "should print installed tool info");
assert(tr.stdout.indexOf("prepending path: C:\\agent\\_tools\\cacheDir") > -1, "should pre-prend to PATH");
Expand Down Expand Up @@ -139,7 +139,7 @@ describe('DotNetCoreInstaller', function() {
assert(tr.stdout.indexOf("loc_mock_InstallingAfresh") > -1, "should install fresh if cache miss");
assert(tr.stdout.indexOf("Changing attribute for file /somedir/currdir/externals/install-dotnet.sh to 777") > -1, "should iset executable attribute for install script");
assert(tr.stdout.indexOf("Downloading tool from https://primary-url") > -1, "should download from correct url");
assert(tr.stdout.indexOf("Extracting tar archieve from /agent/_temp/someArchieve") > -1, "Should extract downloaded archieve corectly");
assert(tr.stdout.indexOf("Extracting tar archive from /agent/_temp/someArchive.tar") > -1, "Should extract downloaded archive corectly");
assert(tr.stdout.indexOf("Caching dir /agent/_temp/someDir for tool dncs version 1.0.4") > -1, "should cache correctly");
assert(tr.stdout.indexOf("loc_mock_SuccessfullyInstalled sdk 1.0.4") > -1, "should print installed tool info");
assert(tr.stdout.indexOf("prepending path: /agent/_tools/cacheDir") > -1, "should pre-prend to PATH");
Expand All @@ -159,7 +159,7 @@ describe('DotNetCoreInstaller', function() {
assert(tr.stdout.indexOf("Checking local tool for dncr and version 1.0.4") > -1, "should check for local cached tool");
assert(tr.stdout.indexOf("loc_mock_InstallingAfresh") > -1, "should install fresh if cache miss");
assert(tr.stdout.indexOf("Downloading tool from https://primary-runtime-url") > -1, "should download from correct url");
assert(tr.stdout.indexOf("Extracting tar archieve from /agent/_temp/someArchieve") > -1, "Should extract downloaded archieve corectly");
assert(tr.stdout.indexOf("Extracting tar archive from /agent/_temp/someArchive.tar") > -1, "Should extract downloaded archive corectly");
assert(tr.stdout.indexOf("Caching dir /agent/_temp/someDir for tool dncr version 1.0.4") > -1, "should cache correctly");
assert(tr.stdout.indexOf("loc_mock_SuccessfullyInstalled runtime 1.0.4") > -1, "should print installed tool info");
assert(tr.stdout.indexOf("prepending path: /agent/_tools/cacheDir") > -1, "should pre-prend to PATH");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions Tasks/DotNetCoreInstallerV0/Tests/mock_node_modules/tool.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading