test cases

This commit is contained in:
Aparna Jyothi 2025-01-31 13:16:15 +05:30
parent 17e88b6567
commit 19df1001b0
6 changed files with 318 additions and 22 deletions

10
dist/setup/index.js vendored
View file

@ -100157,9 +100157,7 @@ class BaseDistribution {
getMirrorUrlVersions() {
return __awaiter(this, void 0, void 0, function* () {
const initialUrl = this.getDistributionMirrorUrl();
core.info('initialUrl from getDistributionMirrorUrl ' + initialUrl);
const dataUrl = `${initialUrl}/index.json`;
core.info('dataUrl from index ' + dataUrl);
const response = yield this.httpClient.getJson(dataUrl);
return response.result || [];
});
@ -100186,9 +100184,7 @@ class BaseDistribution {
}
getNodejsMirrorURLInfo(version) {
const mirrorURL = this.nodeInfo.mirrorURL;
core.info('mirrorURL from getNodejsMirrorURLInfo ' + mirrorURL);
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
core.info('osArch from translateArchToDistUrl ' + osArch);
version = semver_1.default.clean(version) || '';
const fileName = this.osPlat == 'win32'
? `node-v${version}-win-${osArch}`
@ -100199,7 +100195,6 @@ class BaseDistribution {
: `${fileName}.7z`
: `${fileName}.tar.gz`;
const url = `${mirrorURL}/v${version}/${urlFileName}`;
core.info('url from construct ' + url);
return {
downloadUrl: url,
resolvedVersion: version,
@ -100729,19 +100724,14 @@ class OfficialBuilds extends base_distribution_1.default {
downloadFromMirrorURL() {
return __awaiter(this, void 0, void 0, function* () {
const nodeJsVersions = yield this.getMirrorUrlVersions();
core.info('nodeJsVersions from getMirrorUrVersions ' + nodeJsVersions);
const versions = this.filterVersions(nodeJsVersions);
core.info('versions from filterVersions ' + versions);
const evaluatedVersion = this.evaluateVersions(versions);
core.info('evaluatedVersion from evaluatedVersions ' + evaluatedVersion);
if (!evaluatedVersion) {
throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
}
const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion);
core.info('toolName from getNodejsMirrorURLInfo ' + toolName);
try {
const toolPath = yield this.downloadNodejs(toolName);
core.info('toolPath from downloadNodejs ' + toolPath);
return toolPath;
}
catch (error) {