fix: do not use fallback download URLs if custom baseUrl is provided (#12206)

This commit is contained in:
Alex Rudenko 2024-04-04 16:21:55 +02:00 committed by GitHub
parent 4ec0280080
commit ab560bcf6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -92,6 +92,11 @@ export interface InstallOptions {
* @defaultValue `true`
*/
unpack?: boolean;
/**
* @internal
* @defaultValue `false`
*/
forceFallbackForTesting?: boolean;
}
/**
@ -125,6 +130,10 @@ export async function install(
try {
return await installUrl(url, options);
} catch (err) {
// If custom baseUrl is provided, do not fall back to CfT dashboard.
if (options.baseUrl && !options.forceFallbackForTesting) {
throw err;
}
debugInstall(`Error downloading from ${url}.`);
switch (options.browser) {
case Browser.CHROME:

View File

@ -151,6 +151,7 @@ describe('Chrome install', () => {
platform: BrowserPlatform.LINUX,
buildId: testChromeBuildId,
baseUrl: 'https://127.0.0.1',
forceFallbackForTesting: true,
});
assert.strictEqual(fs.existsSync(expectedOutputPath), true);
});