From 0f6638190e59f4a42e8cac022e4a15a253fa8fcd Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 11 Apr 2022 14:42:21 -0600 Subject: [PATCH] fix: do not require `--force` flag when installing channel on CI (#13487) --- .github/workflows/tests_secondary.yml | 30 +++++++++---------- .../src/server/registry/index.ts | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml index d02170cd47..4607cf4926 100644 --- a/.github/workflows/tests_secondary.yml +++ b/.github/workflows/tests_secondary.yml @@ -234,7 +234,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force chrome + - run: npx playwright install --with-deps chrome - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: chrome @@ -259,7 +259,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force chrome + - run: npx playwright install --with-deps chrome - run: npm run ctest shell: bash env: @@ -286,7 +286,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force chrome + - run: npx playwright install --with-deps chrome - run: npm run ctest env: PWTEST_CHANNEL: chrome @@ -388,7 +388,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge + - run: npx playwright install --with-deps msedge - run: npm run ctest env: PWTEST_CHANNEL: msedge @@ -414,7 +414,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge + - run: npx playwright install --with-deps msedge - run: npm run ctest shell: bash env: @@ -438,7 +438,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge + - run: npx playwright install --with-deps msedge - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: msedge @@ -463,7 +463,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge-beta + - run: npx playwright install --with-deps msedge-beta - run: npm run ctest env: PWTEST_CHANNEL: msedge-beta @@ -488,7 +488,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge-beta + - run: npx playwright install --with-deps msedge-beta - run: npm run ctest shell: bash env: @@ -512,7 +512,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge-beta + - run: npx playwright install --with-deps msedge-beta - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: msedge-beta @@ -537,7 +537,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge-dev + - run: npx playwright install --with-deps msedge-dev - run: npm run ctest env: PWTEST_CHANNEL: msedge-dev @@ -562,7 +562,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge-dev + - run: npx playwright install --with-deps msedge-dev - run: npm run ctest shell: bash env: @@ -586,7 +586,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force msedge-dev + - run: npx playwright install --with-deps msedge-dev - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: msedge-dev @@ -611,7 +611,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force chrome-beta + - run: npx playwright install --with-deps chrome-beta - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: chrome-beta @@ -636,7 +636,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force chrome-beta + - run: npx playwright install --with-deps chrome-beta - run: npm run ctest shell: bash env: @@ -663,7 +663,7 @@ jobs: env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - - run: npx playwright install --with-deps --force chrome-beta + - run: npx playwright install --with-deps chrome-beta - run: npm run ctest env: PWTEST_CHANNEL: chrome-beta diff --git a/packages/playwright-core/src/server/registry/index.ts b/packages/playwright-core/src/server/registry/index.ts index 13b0d56158..c3642e2333 100644 --- a/packages/playwright-core/src/server/registry/index.ts +++ b/packages/playwright-core/src/server/registry/index.ts @@ -600,7 +600,7 @@ export class Registry { throw new Error(`ERROR: Playwright does not support installing ${executable.name}`); const { langName } = getClientLanguage(); - if (!executable._isHermeticInstallation && !forceReinstall && executable.executablePath(langName)) { + if (!getAsBooleanFromENV('CI') && !executable._isHermeticInstallation && !forceReinstall && executable.executablePath(langName)) { const command = buildPlaywrightCLICommand(langName, 'install --force ' + executable.name); throw new Error('\n' + wrapInASCIIBox([ `ATTENTION: "${executable.name}" is already installed on the system!`,