Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable auto-update-to tests, auto-update-from on mac and upload logs COMPASS-9063 COMPASS-8128 #6749

Merged
merged 17 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions .github/workflows/test-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +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
# TODO: Enable (needs a docker container)
- linux_tar
- linux_rpm
hadron-distribution:
- compass
Expand Down Expand Up @@ -78,10 +76,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
Expand All @@ -105,12 +103,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
Expand All @@ -121,18 +113,20 @@ jobs:
test: auto-update-from
- hadron-distribution: compass-readonly
test: auto-update-to
# Temporary skip failing auto-update-to tests

# 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_dmg
package: osx_zip
- 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
package: linux_tar
- test: auto-update-to
package: linux_rpm

Expand Down Expand Up @@ -206,3 +200,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
2 changes: 1 addition & 1 deletion packages/compass-e2e-tests/tests/auto-update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion packages/compass-smoke-tests/src/installers/linux-tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 7 additions & 5 deletions packages/compass-smoke-tests/src/tests/auto-update-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading