From 7381229a164e598e7523862f2438cd0cd1cd796a Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 13 Apr 2023 10:20:02 +0200 Subject: [PATCH] fix: report install errors properly (#10016) --- packages/browsers/src/install.ts | 2 -- .../browsers/test/src/chrome/install.spec.ts | 26 +++++++++++++++++++ packages/browsers/test/src/versions.ts | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/browsers/src/install.ts b/packages/browsers/src/install.ts index 48f25d7c3ef..92354b41c9b 100644 --- a/packages/browsers/src/install.ts +++ b/packages/browsers/src/install.ts @@ -185,8 +185,6 @@ export async function install( } finally { debugTimeEnd('extract'); } - } catch (err) { - debugInstall(`Error during installation`, err); } finally { if (existsSync(archivePath)) { await unlink(archivePath); diff --git a/packages/browsers/test/src/chrome/install.spec.ts b/packages/browsers/test/src/chrome/install.spec.ts index 402306d5da5..b150acf1653 100644 --- a/packages/browsers/test/src/chrome/install.spec.ts +++ b/packages/browsers/test/src/chrome/install.spec.ts @@ -102,6 +102,32 @@ describe('Chrome install', () => { assert.ok(fs.existsSync(expectedOutputPath)); }); + it('throws on invalid URL', async function () { + const expectedOutputPath = path.join( + tmpDir, + 'chrome', + `${BrowserPlatform.LINUX}-${testChromeBuildId}` + ); + assert.strictEqual(fs.existsSync(expectedOutputPath), false); + + async function installThatThrows(): Promise { + try { + await install({ + cacheDir: tmpDir, + browser: Browser.CHROME, + platform: BrowserPlatform.LINUX, + buildId: testChromeBuildId, + baseUrl: 'https://127.0.0.1', + }); + return undefined; + } catch (err) { + return err; + } + } + assert.ok(await installThatThrows()); + assert.strictEqual(fs.existsSync(expectedOutputPath), false); + }); + describe('with proxy', () => { const proxyUrl = new URL(`http://localhost:54321`); let proxyServer: http.Server; diff --git a/packages/browsers/test/src/versions.ts b/packages/browsers/test/src/versions.ts index 56440c8b187..606827fe3c3 100644 --- a/packages/browsers/test/src/versions.ts +++ b/packages/browsers/test/src/versions.ts @@ -18,5 +18,5 @@ export const testChromeBuildId = '113.0.5672.0'; export const testChromiumBuildId = '1083080'; // TODO: We can add a Cron job to auto-update on change. // Firefox keeps only `latest` version of Nightly builds. -export const testFirefoxBuildId = '113.0a1'; +export const testFirefoxBuildId = '114.0a1'; export const testChromeDriverBuildId = '112.0.5615.49';