Skip to content

Commit 31cf841

Browse files
authored
feat(e2e): Smoke tests task & initial entrypoint COMPASS-8531 (#6571)
* initial smoketest task & entrypoint * limit to just ubuntu and just the compass distribution for now * correct package * fine. no shebang * xor the IS_* platform options * verify once * add error callback
1 parent afba96b commit 31cf841

File tree

11 files changed

+474
-9
lines changed

11 files changed

+474
-9
lines changed

.evergreen/buildvariants-and-tasks.in.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,40 @@ const PACKAGE_BUILD_VARIANTS = [
6060
}
6161
];
6262
63+
const SMOKETEST_BUILD_VARIANTS = [
64+
{
65+
name: 'smoketest-ubuntu',
66+
display_name: 'Smoketest Ubuntu',
67+
run_on: 'ubuntu2004-large',
68+
depends_on: 'package-ubuntu',
69+
},
70+
71+
// {
72+
// name: 'smoketest-windows',
73+
// display_name: 'Smoketest Windows',
74+
// run_on: 'windows-vsCurrent-large',
75+
// depends_on: 'package-windows',
76+
// },
77+
// {
78+
// name: 'smoketest-rhel',
79+
// display_name: 'Smoketest RHEL',
80+
// run_on: 'rhel80-large',
81+
// depends_on: 'package-rhel',
82+
// },
83+
// {
84+
// name: 'smoketest-macos-x64',
85+
// display_name: 'Smoketest MacOS Intel',
86+
// run_on: 'macos-14',
87+
// depends_on: 'package-macos-x64',
88+
// },
89+
// {
90+
// name: 'smoketest-macos-arm',
91+
// display_name: 'Smoketest MacOS Arm64',
92+
// run_on: 'macos-14-arm64',
93+
// depends_on: 'package-macos-arm',
94+
// }
95+
];
96+
6397
const TEST_PACKAGED_APP_BUILD_VARIANTS = [
6498
{
6599
name: 'test-packaged-app-ubuntu',
@@ -180,6 +214,19 @@ buildvariants:
180214
<% } %>
181215
<% } %>
182216

217+
<% for (const buildVariant of SMOKETEST_BUILD_VARIANTS) { %>
218+
<% for (const distribution of ['compass']) { %>
219+
- name: <%= buildVariant.name %>-<%= distribution %>
220+
display_name: <%= buildVariant.display_name %> (<%= distribution %>)
221+
run_on: <%= buildVariant.run_on %>
222+
depends_on:
223+
- name: package-<%= distribution %>
224+
variant: <%= buildVariant.depends_on %>
225+
tasks:
226+
- name: smoketest-<%= distribution %>
227+
<% } %>
228+
<% } %>
229+
183230
- name: test-eol-servers
184231
display_name: Test EoL Servers
185232
run_on: ubuntu1804-large
@@ -424,6 +471,22 @@ tasks:
424471
- func: save-all-artifacts
425472
vars:
426473
compass_distribution: <%= distribution %>
474+
<% } %>
475+
476+
<% for (const distribution of ['compass']) { %>
477+
- name: smoketest-<%= distribution %>
478+
tags: ['required-for-publish', 'run-on-pr']
479+
commands:
480+
- func: prepare
481+
- func: install
482+
- func: bootstrap
483+
vars:
484+
scope: 'compass-e2e-tests'
485+
- func: smoketest-packaged-app
486+
vars:
487+
mongodb_version: latest-enterprise
488+
compass_distribution: <%= distribution %>
489+
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
427490
<% } %>
428491

429492
<% for (const serverVersion of SERVER_VERSIONS) { %>

.evergreen/buildvariants-and-tasks.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ buildvariants:
7676
- name: package-compass
7777
- name: package-compass-isolated
7878
- name: package-compass-readonly
79+
- name: smoketest-ubuntu-compass
80+
display_name: Smoketest Ubuntu (compass)
81+
run_on: ubuntu2004-large
82+
depends_on:
83+
- name: package-compass
84+
variant: package-ubuntu
85+
tasks:
86+
- name: smoketest-compass
7987
- name: test-eol-servers
8088
display_name: Test EoL Servers
8189
run_on: ubuntu1804-large
@@ -472,6 +480,21 @@ tasks:
472480
- func: save-all-artifacts
473481
vars:
474482
compass_distribution: compass-readonly
483+
- name: smoketest-compass
484+
tags:
485+
- required-for-publish
486+
- run-on-pr
487+
commands:
488+
- func: prepare
489+
- func: install
490+
- func: bootstrap
491+
vars:
492+
scope: compass-e2e-tests
493+
- func: smoketest-packaged-app
494+
vars:
495+
mongodb_version: latest-enterprise
496+
compass_distribution: compass
497+
debug: compass-e2e-tests*,electron*,hadron*,mongo*
475498
- name: test-server-40x-community-1
476499
tags:
477500
- required-for-publish

.evergreen/functions.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,31 @@ functions:
651651
652652
npm run --unsafe-perm --workspace compass-e2e-tests test-packaged-ci
653653
654+
smoketest-packaged-app:
655+
- command: shell.exec
656+
# Fail the task if it's idle for 10 mins
657+
timeout_secs: 600
658+
params:
659+
working_dir: src
660+
shell: bash
661+
env:
662+
<<: *compass-env
663+
DEBUG: ${debug|}
664+
MONGODB_VERSION: ${mongodb_version|}
665+
MONGODB_RUNNER_VERSION: ${mongodb_version|}
666+
HADRON_DISTRIBUTION: ${compass_distribution}
667+
script: |
668+
set -e
669+
# Load environment variables
670+
eval $(.evergreen/print-compass-env.sh)
671+
672+
if [[ "$IS_OSX" == "true" ]]; then
673+
echo "Disabling clipboard usage in e2e tests (TODO: https://jira.mongodb.org/browse/BUILD-14780)"
674+
export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true"
675+
fi
676+
677+
npm run --workspace compass-e2e-tests smoketest
678+
654679
test-web-sandbox:
655680
- command: shell.exec
656681
# Fail the task if it's idle for 10 mins

.evergreen/preinstall.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ echo "NPM_VERSION: $NPM_VERSION"
1212
echo "APPDATA: $APPDATA"
1313
echo "PATH: $PATH"
1414

15+
# these are super useful if you want to run the smoke tests locally
16+
echo "DEV_VERSION_IDENTIFIER: $DEV_VERSION_IDENTIFIER"
17+
echo "EVERGREEN_BUCKET_NAME: $EVERGREEN_BUCKET_NAME"
18+
echo "EVERGREEN_BUCKET_KEY_PREFIX: $EVERGREEN_BUCKET_KEY_PREFIX"
19+
1520
echo "IS_OSX: $IS_OSX"
1621
echo "IS_LINUX: $IS_LINUX"
1722
echo "IS_WINDOWS: $IS_WINDOWS"

packages/compass-e2e-tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.log
33
fixtures/*.csv
44
fixtures/*.json
5+
hadron-build-info.json

packages/compass-e2e-tests/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"test-web": "env DEBUG=hadron*,mongo*,compass*,xvfb-maybe* npm run test web",
2929
"test-web-noserver": "env DEBUG=hadron*,mongo*,compass*,xvfb-maybe* npm run test web -- --disable-start-stop --bail",
3030
"coverage-merge": "nyc merge .log/coverage .nyc_output/coverage.json",
31-
"coverage-report": "npm run coverage-merge && nyc report"
31+
"coverage-report": "npm run coverage-merge && nyc report",
32+
"smoketest": "ts-node smoke-test.ts"
3233
},
3334
"devDependencies": {
3435
"@electron/rebuild": "^3.7.1",

0 commit comments

Comments
 (0)