Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ functions:
fi

if [[ "$IS_RHEL" == "true" ]]; then
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_rpm --tests=time-to-first-query
# npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_rpm --tests=time-to-first-query
Copy link
Contributor Author

@kraenhansen kraenhansen Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to disable this on Evergreen, since it's not running as root and the tests now assume that: https://spruce.mongodb.com/version/67b042493a26aa0007abde21/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=smoketest-rhel-compass

npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_tar --tests=time-to-first-query
fi

Expand Down
37 changes: 30 additions & 7 deletions .github/workflows/test-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# TODO: Re-enable (see https://github.com/mongodb-js/compass/actions/runs/13281152689/job/37079619474)
# - linux_tar
# TODO: Enable (needs a docker container)
# - linux_rpm
- linux_rpm
hadron-distribution:
- compass
- compass-readonly
Expand Down Expand Up @@ -78,10 +78,21 @@ jobs:
# runs-on: ubuntu-latest
# arch: x64
# hadron-platform: linux
# - package: linux_rpm
# runs-on: ubuntu-latest
# arch: x64
# hadron-platform: linux
- package: linux_rpm
runs-on: ubuntu-latest
arch: x64
hadron-platform: linux
distro-id: rhel80
post-checkout-command: |
dnf install -y gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb yum-utils
# Enable the devel repo to install compat-openssl11 (bringing libcrupto.so.1.1 to run mongod)
dnf config-manager --set-enabled devel
dnf update -y
dnf install -y compat-openssl11
container:
image: rockylinux:9
volumes:
- ${{ github.workspace }}:/compass

# Install the update server for auto-update tests
- test: auto-update-from
Expand Down Expand Up @@ -115,15 +126,19 @@ jobs:
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
- hadron-distribution: compass-readonly
test: time-to-first-query

runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.container }}
env:
DEBUG: compass:smoketests:*
steps:
Expand All @@ -134,6 +149,11 @@ jobs:
with:
node-version: 20
cache: "npm"

- name: Run post-checkout command
if: matrix.post-checkout-command
run: ${{ matrix.post-checkout-command }}

- name: Cache downloads
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -161,10 +181,10 @@ jobs:
token: ${{ steps.app-token.outputs.token }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
path: 'compass-mongodb-com'
path: compass-mongodb-com
- name: Install Compass Update server
if: matrix.install-update-server
run: npm install --no-save --workspace packages/compass-smoke-tests ${{ github.workspace }}/compass-mongodb-com
run: npm install --no-save --workspace packages/compass-smoke-tests ./compass-mongodb-com

- name: Run tests
env:
Expand All @@ -174,6 +194,9 @@ jobs:
HADRON_DISTRIBUTION: ${{ matrix.hadron-distribution }}
PLATFORM: ${{ matrix.hadron-platform }}
ARCH: ${{ matrix.arch }}
# Useful to pass a "fake" DISTRO_ID environment to inform the "mongodb-download-url" package
# See https://github.com/mongodb-js/devtools-shared/blob/aff66db7b7fc4f8ecaec2383fd4e8c116733a7e4/packages/download-url/src/linux-distro.ts#L14
DISTRO_ID: ${{ matrix.distro-id }}
# Exposing token to prevent update server from being rate limited
GITHUB_TOKEN: ${{ github.token }}
working-directory: packages/compass-smoke-tests
Expand Down
18 changes: 8 additions & 10 deletions packages/compass-smoke-tests/src/installers/linux-rpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ function getPackageName(filepath: string) {
* Check if a package is installed (by name)
*/
export function isInstalled(packageName: string) {
const result = cp.spawnSync(
'sudo',
['dnf', 'list', 'installed', packageName],
{
stdio: 'inherit',
}
);
const result = cp.spawnSync('dnf', ['list', 'installed', packageName], {
stdio: 'inherit',
});
return result.status === 0;
}

Expand All @@ -53,7 +49,7 @@ export function installLinuxRpm({

function uninstall() {
debug('Uninstalling %s', filepath);
execute('sudo', ['dnf', 'remove', '-y', packageName]);
execute('dnf', ['remove', '-y', packageName]);
}

if (isInstalled(packageName)) {
Expand All @@ -71,7 +67,7 @@ export function installLinuxRpm({
!fs.existsSync(installPath),
`Expected no install directory to exist: ${installPath}`
);
execute('sudo', ['dnf', 'install', '-y', filepath]);
execute('dnf', ['install', '-y', filepath]);

assert(isInstalled(packageName), 'Expected the package to be installed');
assert(
Expand All @@ -80,7 +76,9 @@ export function installLinuxRpm({
);

// Check that the executable will run without being quarantined or similar
execute('xvfb-run', [appPath, '--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', [appPath, '--version', '--no-sandbox', '--disable-gpu']);

return {
appName,
Expand Down
Loading