From 1a616c76455750efd10ac844dff54b019a56d8e8 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 25 Feb 2025 13:08:46 +0000 Subject: [PATCH 01/14] try and enable all the skipped tests --- .github/workflows/test-installers.yml | 31 +++---------------- .../src/tests/auto-update-to.ts | 12 ++++--- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index d2aeb5171aa..d668dbf2b64 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -40,8 +40,7 @@ jobs: - windows_msi - windows_setup - linux_deb - # TODO: Re-enable (see https://github.com/mongodb-js/compass/actions/runs/13281152689/job/37079619474) - # - linux_tar + - linux_tar # TODO: Enable (needs a docker container) - linux_rpm hadron-distribution: @@ -78,10 +77,10 @@ jobs: runs-on: ubuntu-latest arch: x64 hadron-platform: linux - # - package: linux_tar - # runs-on: ubuntu-latest - # arch: x64 - # hadron-platform: linux + - package: linux_tar + runs-on: ubuntu-latest + arch: x64 + hadron-platform: linux - package: linux_rpm runs-on: ubuntu-latest arch: x64 @@ -105,12 +104,6 @@ jobs: install-update-server: true exclude: - # TODO: See https://github.com/mongodb-js/compass/actions/runs/13281152689/job/37079620322 - - package: osx_dmg - test: auto-update-from - # TODO: See https://github.com/mongodb-js/compass/actions/runs/13281152689/job/37079621700 - - package: windows_setup - test: auto-update-from # Skip auto-update tests for isolated and readonly distributions for now # This is not supported by the update server we're using in the test harness - hadron-distribution: compass-isolated @@ -121,20 +114,6 @@ jobs: test: auto-update-from - hadron-distribution: compass-readonly test: auto-update-to - # Temporary skip failing auto-update-to tests - - test: auto-update-to - package: osx_dmg - - test: auto-update-to - package: windows_zip - - test: auto-update-to - package: windows_msi - - test: auto-update-to - package: windows_setup - # Waiting for https://github.com/10gen/compass-mongodb-com/pull/122 to be released - - test: auto-update-to - package: linux_deb - - test: auto-update-to - package: linux_rpm # Skip time-to-first-query tests for readonly because it doesn't have editable documents # See https://github.com/mongodb-js/compass/actions/runs/13286945911/job/37097791601 diff --git a/packages/compass-smoke-tests/src/tests/auto-update-to.ts b/packages/compass-smoke-tests/src/tests/auto-update-to.ts index 9f406260047..b9c678b340d 100644 --- a/packages/compass-smoke-tests/src/tests/auto-update-to.ts +++ b/packages/compass-smoke-tests/src/tests/auto-update-to.ts @@ -57,11 +57,13 @@ export async function testAutoUpdateTo(context: SmokeTestsContext) { bucket_key_prefix: context.bucketKeyPrefix, }); } else { - process.env.PUBLISHED_RELEASES = JSON.stringify({ - name: version, - body: version, - bucket_key_prefix: context.bucketKeyPrefix, - }); + process.env.PUBLISHED_RELEASES = JSON.stringify([ + { + name: version, + body: version, + bucket_key_prefix: context.bucketKeyPrefix, + }, + ]); } const server = await startAutoUpdateServer(); From 8056b67f4f68c9a9a8382d8052b8a18289f54a69 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 25 Feb 2025 18:40:30 +0000 Subject: [PATCH 02/14] upload logs --- .github/workflows/test-installers.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index d668dbf2b64..c22a20b7d9f 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -185,3 +185,11 @@ jobs: working-directory: packages/compass-smoke-tests # Using --skipUninstalling --skipCleanup because the runners are ephemeral run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }} --skipUninstall --skipCleanup + + - name: 'Upload logs' + uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{ matrix.hadron-distribution}}-${{ matrix.hadron-platform}}-${{ matrix.arch }}-${{ matrix.package }}-${{ matrix.test }}-logs + path: packages/compass-e2e-tests/.log/ + include-hidden-files: true From 5c8cfd09a336acfaa4d6055c584717191a19ceeb Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Wed, 26 Feb 2025 09:43:48 +0000 Subject: [PATCH 03/14] longer timeout --- packages/compass-e2e-tests/tests/auto-update.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/tests/auto-update.test.ts b/packages/compass-e2e-tests/tests/auto-update.test.ts index f2da620e2ec..36cbe9fe4f9 100644 --- a/packages/compass-e2e-tests/tests/auto-update.test.ts +++ b/packages/compass-e2e-tests/tests/auto-update.test.ts @@ -71,7 +71,7 @@ describe('Auto-update', function () { console.log( 'pause to make sure the app properly exited before starting again' ); - await wait(10_000); + await wait(60_000); console.log('starting compass a second time'); // run the app again and check that the version changed From bfda8853698b202bd335d9eb3fe45d68110cee12 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Wed, 26 Feb 2025 09:44:10 +0000 Subject: [PATCH 04/14] also do the no-sandbox thing on linux_tar --- packages/compass-smoke-tests/src/installers/linux-tar.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/compass-smoke-tests/src/installers/linux-tar.ts b/packages/compass-smoke-tests/src/installers/linux-tar.ts index 01abac423e2..f52974efd2c 100644 --- a/packages/compass-smoke-tests/src/installers/linux-tar.ts +++ b/packages/compass-smoke-tests/src/installers/linux-tar.ts @@ -18,7 +18,14 @@ export function installLinuxTar({ execute('tar', ['-xzvf', filepath, '-C', sandboxPath]); // Check that the executable will run without being quarantined or similar - execute('xvfb-run', [path.resolve(appPath, appName), '--version']); + // Passing --no-sandbox because RHEL and Rocky usually run as root and --disable-gpu to avoid warnings + // (see compass-e2e-tests/helpers/chrome-startup-flags.ts for details) + execute('xvfb-run', [ + path.resolve(appPath, appName), + '--version', + '--no-sandbox', + '--disable-gpu', + ]); return { appName, From 6a41599c65834f0fba1a529259248deb1fde363a Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Wed, 26 Feb 2025 09:47:06 +0000 Subject: [PATCH 05/14] remove comment that seems to be invalid --- .github/workflows/test-installers.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index c22a20b7d9f..4bbef5744bb 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -41,7 +41,6 @@ jobs: - windows_setup - linux_deb - linux_tar - # TODO: Enable (needs a docker container) - linux_rpm hadron-distribution: - compass From 25905824e32fc25df9c485a5c37d325c61a81786 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Wed, 26 Feb 2025 09:54:09 +0000 Subject: [PATCH 06/14] strip down how many auto-update-to tests we run --- .github/workflows/test-installers.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index 4bbef5744bb..9e47afb2b3c 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -114,6 +114,22 @@ jobs: - hadron-distribution: compass-readonly test: auto-update-to + # Skip auto-update-to tests for anything except the one release + # package we install for that platform and arch, because that's the + # only one that gets installed and therefore updated. + # Se https://github.com/10gen/compass-mongodb-com/blob/ae1ce87c54ab8702e94b154ffe2bfb9997b56661/src/routes/update.js#L320-L411 + # ie. only leave osx_dmg, windows_setup, linux_deb, linux_rpm + - test: auto-update-to + package: osx_zip + - test: auto-update-to + package: windows_zip + - test: auto-update-to + package: windows_msi + - test: auto-update-to + package: linux_tar + - test: auto-update-to + package: linux_rpm + # Skip time-to-first-query tests for readonly because it doesn't have editable documents # See https://github.com/mongodb-js/compass/actions/runs/13286945911/job/37097791601 - hadron-distribution: compass-readonly From d1bf298775cd0af9279db3543f4df03079c84756 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Wed, 26 Feb 2025 11:34:04 +0000 Subject: [PATCH 07/14] add a timeout for the test job --- .github/workflows/test-installers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index 9e47afb2b3c..6ce72cb28c2 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -26,6 +26,7 @@ run-name: Test Installers ${{ github.event.inputs.dev_version || github.ref_name jobs: test: name: ${{ matrix.package }} test ${{ matrix.test }} (${{ matrix.hadron-distribution }}) + timeout-minutes: 10 strategy: fail-fast: false matrix: From ca430f2fc84da6f7645880d97acf9a7e17591a0d Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Thu, 27 Feb 2025 15:36:30 +0000 Subject: [PATCH 08/14] disable linux_tar again --- .github/workflows/test-installers.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index 6ce72cb28c2..368b9a7fd19 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -41,7 +41,8 @@ jobs: - windows_msi - windows_setup - linux_deb - - linux_tar + # TODO(COMPASS-9061): Fix and enable the linux_tar smoke tests + #- linux_tar - linux_rpm hadron-distribution: - compass @@ -77,10 +78,11 @@ jobs: runs-on: ubuntu-latest arch: x64 hadron-platform: linux - - package: linux_tar - runs-on: ubuntu-latest - arch: x64 - hadron-platform: linux + # TODO(COMPASS-9061): Fix and enable the linux_tar smoke tests + #- package: linux_tar + # runs-on: ubuntu-latest + # arch: x64 + # hadron-platform: linux - package: linux_rpm runs-on: ubuntu-latest arch: x64 From 2b9fe053ba1c9979cb86c64b700adf27174dd01b Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Thu, 27 Feb 2025 16:07:42 +0000 Subject: [PATCH 09/14] Update .github/workflows/test-installers.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- .github/workflows/test-installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index 368b9a7fd19..6baa352040e 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -120,7 +120,7 @@ jobs: # Skip auto-update-to tests for anything except the one release # package we install for that platform and arch, because that's the # only one that gets installed and therefore updated. - # Se https://github.com/10gen/compass-mongodb-com/blob/ae1ce87c54ab8702e94b154ffe2bfb9997b56661/src/routes/update.js#L320-L411 + # See https://github.com/10gen/compass-mongodb-com/blob/ae1ce87c54ab8702e94b154ffe2bfb9997b56661/src/routes/update.js#L320-L411 # ie. only leave osx_dmg, windows_setup, linux_deb, linux_rpm - test: auto-update-to package: osx_zip From 0c972659dc11c4f202fa23a1f978a01b827bc06a Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Thu, 27 Feb 2025 18:59:46 +0000 Subject: [PATCH 10/14] remove linux_tar fixes --- packages/compass-smoke-tests/src/installers/linux-tar.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/compass-smoke-tests/src/installers/linux-tar.ts b/packages/compass-smoke-tests/src/installers/linux-tar.ts index f52974efd2c..01abac423e2 100644 --- a/packages/compass-smoke-tests/src/installers/linux-tar.ts +++ b/packages/compass-smoke-tests/src/installers/linux-tar.ts @@ -18,14 +18,7 @@ export function installLinuxTar({ execute('tar', ['-xzvf', filepath, '-C', sandboxPath]); // Check that the executable will run without being quarantined or similar - // Passing --no-sandbox because RHEL and Rocky usually run as root and --disable-gpu to avoid warnings - // (see compass-e2e-tests/helpers/chrome-startup-flags.ts for details) - execute('xvfb-run', [ - path.resolve(appPath, appName), - '--version', - '--no-sandbox', - '--disable-gpu', - ]); + execute('xvfb-run', [path.resolve(appPath, appName), '--version']); return { appName, From 000247757d2076e23bebfa89ff458fafed941714 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Thu, 27 Feb 2025 18:59:58 +0000 Subject: [PATCH 11/14] bump timeout --- .github/workflows/test-installers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index 6baa352040e..38050a453a0 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -26,7 +26,7 @@ run-name: Test Installers ${{ github.event.inputs.dev_version || github.ref_name jobs: test: name: ${{ matrix.package }} test ${{ matrix.test }} (${{ matrix.hadron-distribution }}) - timeout-minutes: 10 + timeout-minutes: 30 strategy: fail-fast: false matrix: From 09b13ca1eb54f061afdabd8be18e2cee3956a49a Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 28 Feb 2025 09:58:03 +0000 Subject: [PATCH 12/14] bump the timeout where we wait for the update to finish downloading --- packages/compass-e2e-tests/helpers/test-runner-context.ts | 2 +- packages/compass-e2e-tests/tests/auto-update.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/compass-e2e-tests/helpers/test-runner-context.ts b/packages/compass-e2e-tests/helpers/test-runner-context.ts index b05e059ba32..8f1c6ad08dd 100644 --- a/packages/compass-e2e-tests/helpers/test-runner-context.ts +++ b/packages/compass-e2e-tests/helpers/test-runner-context.ts @@ -51,7 +51,7 @@ function buildCommonArgs(yargs: Argv) { description: 'Set a custom default mocha timeout', // Kinda arbitrary, but longer than webdriver-waitfor-timeout so the test // can fail before Mocha times out - default: 240_000, + default: 300_000, // 5 minutes }) .option('mocha-bail', { type: 'boolean', diff --git a/packages/compass-e2e-tests/tests/auto-update.test.ts b/packages/compass-e2e-tests/tests/auto-update.test.ts index 36cbe9fe4f9..2fbfa4ebcc3 100644 --- a/packages/compass-e2e-tests/tests/auto-update.test.ts +++ b/packages/compass-e2e-tests/tests/auto-update.test.ts @@ -31,7 +31,10 @@ describe('Auto-update', function () { if (process.env.AUTO_UPDATE_UPDATABLE === 'true') { const restartButton = browser.$(Selectors.AutoUpdateRestartButton); - await restartButton.waitForDisplayed(); + // 2 minutes is apparently not always enough for downloading the + // windows update on GHA. Has to be shorter than the mocha test + // timeout so this can fail before the test does. + await restartButton.waitForDisplayed({ timeout: 240_000 }); if (process.env.EXPECTED_UPDATE_VERSION) { expect( From ff18d2456ec388bb3e2fcc38307b5bfb919e72b4 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 28 Feb 2025 16:22:19 +0000 Subject: [PATCH 13/14] disable auto-update-from on windows again --- .github/workflows/test-installers.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index df9f3ecb695..9c22e467370 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -132,6 +132,20 @@ jobs: - hadron-distribution: compass-readonly test: auto-update-to + + # TODO(COMPASS-9067): auto-update-from does not work for windows. Not + # even manually. It downloads the releases file, the toast appears + # that says it is downloading the update, the log appears that says + # thatit is downloading the update, but it never makes the request to + # the update server to actually download the .nupkg file. Strangely + # auto-update-to works. (which starts with the latest release and then + # updates to the newly packaged one) and auto-updating from an old dev + # version also works. it seems to be the fact that it is actually + # downgrading from the new package to the most recent release that + # breaks it? Can't see any other difference. + - test: auto-update-from + package: windows_setup + # Skip auto-update-to tests for anything except the one release # package we install for that platform and arch, because that's the # only one that gets installed and therefore updated. From e2787f0c7e9682b382a65f7ebaf8bb923445bb02 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 28 Feb 2025 17:07:06 +0000 Subject: [PATCH 14/14] Revert "bump the timeout where we wait for the update to finish downloading" This reverts commit 09b13ca1eb54f061afdabd8be18e2cee3956a49a. --- packages/compass-e2e-tests/helpers/test-runner-context.ts | 2 +- packages/compass-e2e-tests/tests/auto-update.test.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/compass-e2e-tests/helpers/test-runner-context.ts b/packages/compass-e2e-tests/helpers/test-runner-context.ts index 8f1c6ad08dd..b05e059ba32 100644 --- a/packages/compass-e2e-tests/helpers/test-runner-context.ts +++ b/packages/compass-e2e-tests/helpers/test-runner-context.ts @@ -51,7 +51,7 @@ function buildCommonArgs(yargs: Argv) { description: 'Set a custom default mocha timeout', // Kinda arbitrary, but longer than webdriver-waitfor-timeout so the test // can fail before Mocha times out - default: 300_000, // 5 minutes + default: 240_000, }) .option('mocha-bail', { type: 'boolean', diff --git a/packages/compass-e2e-tests/tests/auto-update.test.ts b/packages/compass-e2e-tests/tests/auto-update.test.ts index 2fbfa4ebcc3..36cbe9fe4f9 100644 --- a/packages/compass-e2e-tests/tests/auto-update.test.ts +++ b/packages/compass-e2e-tests/tests/auto-update.test.ts @@ -31,10 +31,7 @@ describe('Auto-update', function () { if (process.env.AUTO_UPDATE_UPDATABLE === 'true') { const restartButton = browser.$(Selectors.AutoUpdateRestartButton); - // 2 minutes is apparently not always enough for downloading the - // windows update on GHA. Has to be shorter than the mocha test - // timeout so this can fail before the test does. - await restartButton.waitForDisplayed({ timeout: 240_000 }); + await restartButton.waitForDisplayed(); if (process.env.EXPECTED_UPDATE_VERSION) { expect(