From 55d974d7b22faefb7f6a86f85b4618aa53f5ca1b Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 2 May 2023 17:10:53 +0200 Subject: [PATCH] Bump Circle CI docker image (#18914) * Bump Circle CI docker image * Stop removing FF since it doesn't exist * Use Circle CI browser tools * Fix config name * Fix browser tools args * Fix Chrome version * Use script for chrome * Try update * Try FF without browser-tools2 * Fix FF binary path * Force enable e2e debug * Add some logs * More logs * Disable XSET check for now * Delete x-server logic * remove another usage of the x-server logic --- .circleci/config.yml | 4 ++-- .circleci/scripts/chrome-install.sh | 2 ++ .circleci/scripts/firefox-install.sh | 4 ---- test/e2e/helpers.js | 8 +------- test/e2e/metamask-ui.spec.js | 7 ------- test/e2e/webdriver/firefox.js | 3 +++ test/e2e/x-server.js | 17 ----------------- 7 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 test/e2e/x-server.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 467aabc59..090d1356e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,10 +3,10 @@ version: 2.1 executors: node-browsers: docker: - - image: circleci/node:16-browsers + - image: cimg/node:16.20-browsers node-browsers-medium-plus: docker: - - image: circleci/node:16-browsers + - image: cimg/node:16.20-browsers resource_class: medium+ environment: NODE_OPTIONS: --max_old_space_size=2048 diff --git a/.circleci/scripts/chrome-install.sh b/.circleci/scripts/chrome-install.sh index cc83d987e..450293197 100755 --- a/.circleci/scripts/chrome-install.sh +++ b/.circleci/scripts/chrome-install.sh @@ -4,6 +4,8 @@ set -e set -u set -o pipefail +sudo apt-get update + # To get the latest version, see CHROME_VERSION='111.0.5563.64-1' CHROME_BINARY="google-chrome-stable_${CHROME_VERSION}_amd64.deb" diff --git a/.circleci/scripts/firefox-install.sh b/.circleci/scripts/firefox-install.sh index be31f8bf4..4cb30ec32 100755 --- a/.circleci/scripts/firefox-install.sh +++ b/.circleci/scripts/firefox-install.sh @@ -9,10 +9,6 @@ FIREFOX_BINARY="firefox-${FIREFOX_VERSION}.tar.bz2" FIREFOX_BINARY_URL="https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/${FIREFOX_BINARY}" FIREFOX_PATH='/opt/firefox' -printf '%s\n' "Removing old Firefox installation" - -sudo rm -r "${FIREFOX_PATH}" - printf '%s\n' "Downloading & installing Firefox ${FIREFOX_VERSION}" wget --quiet --show-progress -O- "${FIREFOX_BINARY_URL}" | sudo tar xj -C /opt diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 1dfccf73f..bc46e568f 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -10,7 +10,6 @@ const FixtureServer = require('./fixture-server'); const PhishingWarningPageServer = require('./phishing-warning-page-server'); const { buildWebDriver } = require('./webdriver'); const { PAGES } = require('./webdriver/driver'); -const { ensureXServerIsRunning } = require('./x-server'); const GanacheSeeder = require('./seeder/ganache-seeder'); const tinyDelayMs = 200; @@ -107,12 +106,7 @@ async function withFixtures(options, testSuite) { } const mockedEndpoint = await setupMocking(mockServer, testSpecificMock); await mockServer.start(8000); - if ( - process.env.SELENIUM_BROWSER === 'chrome' && - process.env.CI === 'true' - ) { - await ensureXServerIsRunning(); - } + driver = (await buildWebDriver(driverOptions)).driver; webDriver = driver.driver; diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index e3a53ffdd..c2b630c8f 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -11,7 +11,6 @@ const { } = require('./helpers'); const { buildWebDriver } = require('./webdriver'); const Ganache = require('./ganache'); -const { ensureXServerIsRunning } = require('./x-server'); const ganacheServer = new Ganache(); const dappPort = 8080; @@ -45,12 +44,6 @@ describe('MetaMask', function () { dappServer.on('listening', resolve); dappServer.on('error', reject); }); - if ( - process.env.SELENIUM_BROWSER === 'chrome' && - process.env.CI === 'true' - ) { - await ensureXServerIsRunning(); - } const result = await buildWebDriver(); driver = result.driver; await driver.navigate(); diff --git a/test/e2e/webdriver/firefox.js b/test/e2e/webdriver/firefox.js index 6bb90b9ab..52e936f09 100644 --- a/test/e2e/webdriver/firefox.js +++ b/test/e2e/webdriver/firefox.js @@ -42,6 +42,9 @@ class FirefoxDriver { 'browser.download.dir', `${process.cwd()}/test-artifacts/downloads`, ); + if (process.env.CI === 'true') { + options.setBinary('/opt/firefox/firefox'); + } const builder = new Builder() .forBrowser('firefox') .setFirefoxOptions(options); diff --git a/test/e2e/x-server.js b/test/e2e/x-server.js deleted file mode 100644 index 9be32b099..000000000 --- a/test/e2e/x-server.js +++ /dev/null @@ -1,17 +0,0 @@ -const { runCommand } = require('../../development/lib/run-command'); -const { retry } = require('../../development/lib/retry'); - -function ensureXServerIsRunning() { - return retry( - { - retries: 3, - delay: 2000, - rejectionMessage: 'X server does not seem to be running?!', - }, - () => { - return runCommand('xset', ['q']); - }, - ); -} - -module.exports = { ensureXServerIsRunning };