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

View file

@ -107,10 +107,8 @@ export default abstract class BaseDistribution {
protected async getMirrorUrlVersions(): Promise<INodeVersion[]> {
const initialUrl = this.getDistributionMirrorUrl();
core.info('initialUrl from getDistributionMirrorUrl '+initialUrl);
const dataUrl = `${initialUrl}/index.json`;
core.info('dataUrl from index '+dataUrl);
const response = await this.httpClient.getJson<INodeVersion[]>(dataUrl);
return response.result || [];
@ -142,10 +140,8 @@ export default abstract class BaseDistribution {
protected getNodejsMirrorURLInfo(version: string) {
const mirrorURL = this.nodeInfo.mirrorURL;
core.info('mirrorURL from getNodejsMirrorURLInfo '+mirrorURL);
const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch);
core.info('osArch from translateArchToDistUrl '+osArch);
version = semver.clean(version) || '';
const fileName: string =
@ -160,7 +156,6 @@ export default abstract class BaseDistribution {
: `${fileName}.tar.gz`;
const url = `${mirrorURL}/v${version}/${urlFileName}`;
core.info('url from construct '+url);
return <INodeVersionInfo>{
downloadUrl: url,

View file

@ -318,14 +318,11 @@ export default class OfficialBuilds extends BaseDistribution {
protected async downloadFromMirrorURL() {
const nodeJsVersions = await 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) {
@ -336,12 +333,10 @@ export default class OfficialBuilds extends BaseDistribution {
const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion);
core.info('toolName from getNodejsMirrorURLInfo '+toolName);
try {
const toolPath = await this.downloadNodejs(toolName);
core.info('toolPath from downloadNodejs '+toolPath);
return toolPath;
} catch (error) {