From f79a25a386f30ac2e0b7b891210ec0cc87025474 Mon Sep 17 00:00:00 2001 From: Miki Date: Tue, 16 May 2023 19:42:37 -0700 Subject: [PATCH] Revert "Temporarily hardcode chromedriver to 112.0.0 to enable all ftr tests (#3976)" This reverts commit 5ea0cbe25223e24badfe27f79813ee313c9af0b0. --- CHANGELOG.md | 1 - scripts/upgrade_chromedriver.js | 27 ++++++--------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17c86ec89bb8..d4bcc88cf719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -215,7 +215,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Prevent primitive linting limitations from being applied to unit tests found under `src/setup_node_env` ([#3403](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3403)) - [Tests] Fix unit tests for `get_keystore` ([#3854](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3854)) - [Tests] Use `scripts/use_node` instead of `node` in functional test plugins ([#3783](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3783)) -- Temporarily hardcode the largest support `chromedriver` version to `112.0.0` to enable all ftr tests ([#3976](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3976)) ## [2.x] diff --git a/scripts/upgrade_chromedriver.js b/scripts/upgrade_chromedriver.js index 224486bb9867..3aa896fd1fa9 100644 --- a/scripts/upgrade_chromedriver.js +++ b/scripts/upgrade_chromedriver.js @@ -71,31 +71,16 @@ versionCheckCommands.some((cmd) => { const majorVersion = versionCheckOutput?.match?.(/(?:^|\s)(9\d|\d{3})\./)?.[1]; if (majorVersion) { - let targetVersion = `^${majorVersion}`; - - // TODO: Temporary fix to install chromedriver 112.0.0 if major version is 112. - // Exit if major version is greater than 112. - // Revert this once node is bumped to 16+. - // https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3975 - if (parseInt(majorVersion) === 112) { - targetVersion = '112.0.0'; - } else if (parseInt(majorVersion) > 112) { - console.error( - `::error::Chrome version (${majorVersion}) is not supported by this script. The largest chrome version we support is 112.` - ); - process.exit(1); - } - if (process.argv.includes('--install')) { - console.log(`Installing chromedriver@${targetVersion}`); + console.log(`Installing chromedriver@^${majorVersion}`); - spawnSync(`yarn add --dev chromedriver@${targetVersion}`, { + spawnSync(`yarn add --dev chromedriver@^${majorVersion}`, { stdio: 'inherit', cwd: process.cwd(), shell: true, }); } else { - console.log(`Upgrading to chromedriver@${targetVersion}`); + console.log(`Upgrading to chromedriver@^${majorVersion}`); let upgraded = false; const writeStream = createWriteStream('package.json.upgrading-chromedriver', { flags: 'w' }); @@ -107,7 +92,7 @@ if (majorVersion) { if (line.includes('"chromedriver": "')) { line = line.replace( /"chromedriver":\s*"[~^]?\d[\d.]*\d"/, - `"chromedriver": "${targetVersion}"` + `"chromedriver": "^${majorVersion}"` ); upgraded = true; } @@ -122,11 +107,11 @@ if (majorVersion) { renameSync('package.json', 'package.json.bak'); renameSync('package.json.upgrading-chromedriver', 'package.json'); - console.log(`Backed up package.json and updated chromedriver to ${targetVersion}`); + console.log(`Backed up package.json and updated chromedriver to ${majorVersion}`); } else { unlinkSync('package.json.upgrading-chromedriver'); console.error( - `Failed to update chromedriver to ${targetVersion}. Try adding the \`--install\` switch.` + `Failed to update chromedriver to ${majorVersion}. Try adding the \`--install\` switch.` ); } });