Skip to content

Commit d3f8ade

Browse files
authored
chore(smoke-tests): Run RPM tests on Rocky linux (#6725)
* Run Linux RPM in Rocky container * Fix installing the update server * Skipping auto-update-to for RPM as well * Disable linux_rpm on Evergreen
1 parent 775f8f3 commit d3f8ade

File tree

3 files changed

+39
-18
lines changed

3 files changed

+39
-18
lines changed

.evergreen/functions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ functions:
698698
fi
699699
700700
if [[ "$IS_RHEL" == "true" ]]; then
701-
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_rpm --tests=time-to-first-query
701+
# npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_rpm --tests=time-to-first-query
702702
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_tar --tests=time-to-first-query
703703
fi
704704

.github/workflows/test-installers.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# TODO: Re-enable (see https://github.com/mongodb-js/compass/actions/runs/13281152689/job/37079619474)
4040
# - linux_tar
4141
# TODO: Enable (needs a docker container)
42-
# - linux_rpm
42+
- linux_rpm
4343
hadron-distribution:
4444
- compass
4545
- compass-readonly
@@ -78,10 +78,21 @@ jobs:
7878
# runs-on: ubuntu-latest
7979
# arch: x64
8080
# hadron-platform: linux
81-
# - package: linux_rpm
82-
# runs-on: ubuntu-latest
83-
# arch: x64
84-
# hadron-platform: linux
81+
- package: linux_rpm
82+
runs-on: ubuntu-latest
83+
arch: x64
84+
hadron-platform: linux
85+
distro-id: rhel80
86+
post-checkout-command: |
87+
dnf install -y gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb yum-utils
88+
# Enable the devel repo to install compat-openssl11 (bringing libcrupto.so.1.1 to run mongod)
89+
dnf config-manager --set-enabled devel
90+
dnf update -y
91+
dnf install -y compat-openssl11
92+
container:
93+
image: rockylinux:9
94+
volumes:
95+
- ${{ github.workspace }}:/compass
8596

8697
# Install the update server for auto-update tests
8798
- test: auto-update-from
@@ -115,15 +126,19 @@ jobs:
115126
package: windows_msi
116127
- test: auto-update-to
117128
package: windows_setup
129+
# Waiting for https://github.com/10gen/compass-mongodb-com/pull/122 to be released
118130
- test: auto-update-to
119131
package: linux_deb
132+
- test: auto-update-to
133+
package: linux_rpm
120134

121135
# Skip time-to-first-query tests for readonly because it doesn't have editable documents
122136
# See https://github.com/mongodb-js/compass/actions/runs/13286945911/job/37097791601
123137
- hadron-distribution: compass-readonly
124138
test: time-to-first-query
125139

126140
runs-on: ${{ matrix.runs-on }}
141+
container: ${{ matrix.container }}
127142
env:
128143
DEBUG: compass:smoketests:*
129144
steps:
@@ -134,6 +149,11 @@ jobs:
134149
with:
135150
node-version: 20
136151
cache: "npm"
152+
153+
- name: Run post-checkout command
154+
if: matrix.post-checkout-command
155+
run: ${{ matrix.post-checkout-command }}
156+
137157
- name: Cache downloads
138158
uses: actions/cache@v4
139159
with:
@@ -161,10 +181,10 @@ jobs:
161181
token: ${{ steps.app-token.outputs.token }}
162182
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
163183
persist-credentials: false
164-
path: 'compass-mongodb-com'
184+
path: compass-mongodb-com
165185
- name: Install Compass Update server
166186
if: matrix.install-update-server
167-
run: npm install --no-save --workspace packages/compass-smoke-tests ${{ github.workspace }}/compass-mongodb-com
187+
run: npm install --no-save --workspace packages/compass-smoke-tests ./compass-mongodb-com
168188

169189
- name: Run tests
170190
env:
@@ -174,6 +194,9 @@ jobs:
174194
HADRON_DISTRIBUTION: ${{ matrix.hadron-distribution }}
175195
PLATFORM: ${{ matrix.hadron-platform }}
176196
ARCH: ${{ matrix.arch }}
197+
# Useful to pass a "fake" DISTRO_ID environment to inform the "mongodb-download-url" package
198+
# See https://github.com/mongodb-js/devtools-shared/blob/aff66db7b7fc4f8ecaec2383fd4e8c116733a7e4/packages/download-url/src/linux-distro.ts#L14
199+
DISTRO_ID: ${{ matrix.distro-id }}
177200
# Exposing token to prevent update server from being rate limited
178201
GITHUB_TOKEN: ${{ github.token }}
179202
working-directory: packages/compass-smoke-tests

packages/compass-smoke-tests/src/installers/linux-rpm.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ function getPackageName(filepath: string) {
3030
* Check if a package is installed (by name)
3131
*/
3232
export function isInstalled(packageName: string) {
33-
const result = cp.spawnSync(
34-
'sudo',
35-
['dnf', 'list', 'installed', packageName],
36-
{
37-
stdio: 'inherit',
38-
}
39-
);
33+
const result = cp.spawnSync('dnf', ['list', 'installed', packageName], {
34+
stdio: 'inherit',
35+
});
4036
return result.status === 0;
4137
}
4238

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

5450
function uninstall() {
5551
debug('Uninstalling %s', filepath);
56-
execute('sudo', ['dnf', 'remove', '-y', packageName]);
52+
execute('dnf', ['remove', '-y', packageName]);
5753
}
5854

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

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

8278
// Check that the executable will run without being quarantined or similar
83-
execute('xvfb-run', [appPath, '--version']);
79+
// Passing --no-sandbox because RHEL and Rocky usually run as root and --disable-gpu to avoid warnings
80+
// (see compass-e2e-tests/helpers/chrome-startup-flags.ts for details)
81+
execute('xvfb-run', [appPath, '--version', '--no-sandbox', '--disable-gpu']);
8482

8583
return {
8684
appName,

0 commit comments

Comments
 (0)