Merge pull request #4 from dmitry-shibanov/v-dmshib/fix-test-for-aliases

Fix tests for aliases
pull/299/head
Milos Pantic 2 years ago committed by GitHub
commit c7cf12e8f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63231,9 +63231,13 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let manifest; let manifest;
let osPlat = os_1.default.platform(); let osPlat = os_1.default.platform();
if (versionSpec === utils_1.StableReleaseAlias.Stable ||
versionSpec === utils_1.StableReleaseAlias.OldStable) {
manifest = yield getManifest(auth);
versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest);
}
if (checkLatest) { if (checkLatest) {
core.info('Attempting to resolve the latest version from the manifest...'); core.info('Attempting to resolve the latest version from the manifest...');
manifest = yield getManifest(auth);
const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest); const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest);
if (resolvedVersion) { if (resolvedVersion) {
versionSpec = resolvedVersion; versionSpec = resolvedVersion;
@ -63243,11 +63247,6 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
core.info(`Failed to resolve version ${versionSpec} from manifest`); core.info(`Failed to resolve version ${versionSpec} from manifest`);
} }
} }
if (versionSpec === utils_1.StableReleaseAlias.Stable ||
versionSpec === utils_1.StableReleaseAlias.OldStable) {
manifest !== null && manifest !== void 0 ? manifest : (manifest = yield getManifest(auth));
versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest);
}
// check cache // check cache
let toolPath; let toolPath;
toolPath = tc.find('go', versionSpec, arch); toolPath = tc.find('go', versionSpec, arch);
@ -63263,7 +63262,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
// Try download from internal distribution (popular versions only) // Try download from internal distribution (popular versions only)
// //
try { try {
info = yield getInfoFromManifest(versionSpec, true, auth, arch); info = yield getInfoFromManifest(versionSpec, true, auth, arch, manifest);
if (info) { if (info) {
downloadPath = yield installGoVersion(info, auth, arch); downloadPath = yield installGoVersion(info, auth, arch);
} }

19
package-lock.json generated

@ -26,7 +26,7 @@
"jest": "^27.2.5", "jest": "^27.2.5",
"jest-circus": "^27.2.5", "jest-circus": "^27.2.5",
"nock": "^10.0.6", "nock": "^10.0.6",
"prettier": "^2.8.0", "prettier": "^1.17.1",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.3.3" "typescript": "^4.3.3"
} }
@ -4062,18 +4062,15 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.0", "version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin-prettier.js"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=4"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
} }
}, },
"node_modules/pretty-format": { "node_modules/pretty-format": {
@ -8121,9 +8118,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "2.8.0", "version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"dev": true "dev": true
}, },
"pretty-format": { "pretty-format": {

@ -40,7 +40,7 @@
"jest": "^27.2.5", "jest": "^27.2.5",
"jest-circus": "^27.2.5", "jest-circus": "^27.2.5",
"nock": "^10.0.6", "nock": "^10.0.6",
"prettier": "^2.8.0", "prettier": "^1.17.1",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.3.3" "typescript": "^4.3.3"
} }

@ -39,9 +39,21 @@ export async function getGo(
let manifest: tc.IToolRelease[] | undefined; let manifest: tc.IToolRelease[] | undefined;
let osPlat: string = os.platform(); let osPlat: string = os.platform();
if (
versionSpec === StableReleaseAlias.Stable ||
versionSpec === StableReleaseAlias.OldStable
) {
manifest = await getManifest(auth);
versionSpec = await resolveStableVersionInput(
versionSpec,
auth,
arch,
manifest
);
}
if (checkLatest) { if (checkLatest) {
core.info('Attempting to resolve the latest version from the manifest...'); core.info('Attempting to resolve the latest version from the manifest...');
manifest = await getManifest(auth);
const resolvedVersion = await resolveVersionFromManifest( const resolvedVersion = await resolveVersionFromManifest(
versionSpec, versionSpec,
true, true,
@ -57,19 +69,6 @@ export async function getGo(
} }
} }
if (
versionSpec === StableReleaseAlias.Stable ||
versionSpec === StableReleaseAlias.OldStable
) {
manifest ??= await getManifest(auth);
versionSpec = await resolveStableVersionInput(
versionSpec,
auth,
arch,
manifest
);
}
// check cache // check cache
let toolPath: string; let toolPath: string;
toolPath = tc.find('go', versionSpec, arch); toolPath = tc.find('go', versionSpec, arch);
@ -86,7 +85,7 @@ export async function getGo(
// Try download from internal distribution (popular versions only) // Try download from internal distribution (popular versions only)
// //
try { try {
info = await getInfoFromManifest(versionSpec, true, auth, arch); info = await getInfoFromManifest(versionSpec, true, auth, arch, manifest);
if (info) { if (info) {
downloadPath = await installGoVersion(info, auth, arch); downloadPath = await installGoVersion(info, auth, arch);
} else { } else {

Loading…
Cancel
Save