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(e2e): Smoke tests task & initial entrypoint COMPASS-8531 #6571

Merged
merged 14 commits into from
Dec 18, 2024
Merged
63 changes: 63 additions & 0 deletions .evergreen/buildvariants-and-tasks.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,40 @@ const PACKAGE_BUILD_VARIANTS = [
}
];

const SMOKETEST_BUILD_VARIANTS = [
{
name: 'smoketest-ubuntu',
display_name: 'Smoketest Ubuntu',
run_on: 'ubuntu2004-large',
depends_on: 'package-ubuntu',
},

// {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I have most platforms commented out because this is a lot of new tasks that will do nothing for the moment.

// name: 'smoketest-windows',
// display_name: 'Smoketest Windows',
// run_on: 'windows-vsCurrent-large',
// depends_on: 'package-windows',
// },
// {
// name: 'smoketest-rhel',
// display_name: 'Smoketest RHEL',
// run_on: 'rhel80-large',
// depends_on: 'package-rhel',
// },
// {
// name: 'smoketest-macos-x64',
// display_name: 'Smoketest MacOS Intel',
// run_on: 'macos-14',
// depends_on: 'package-macos-x64',
// },
// {
// name: 'smoketest-macos-arm',
// display_name: 'Smoketest MacOS Arm64',
// run_on: 'macos-14-arm64',
// depends_on: 'package-macos-arm',
// }
];

const TEST_PACKAGED_APP_BUILD_VARIANTS = [
{
name: 'test-packaged-app-ubuntu',
Expand Down Expand Up @@ -180,6 +214,19 @@ buildvariants:
<% } %>
<% } %>

<% for (const buildVariant of SMOKETEST_BUILD_VARIANTS) { %>
<% for (const distribution of ['compass']) { %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looping through just compass here rather than all of COMPASS_DISTRIBUTIONS. For now. Until we want to test readonly and isolated.

- name: <%= buildVariant.name %>-<%= distribution %>
display_name: <%= buildVariant.display_name %> (<%= distribution %>)
run_on: <%= buildVariant.run_on %>
depends_on:
- name: package-<%= distribution %>
variant: <%= buildVariant.depends_on %>
tasks:
- name: smoketest-<%= distribution %>
<% } %>
<% } %>

- name: test-eol-servers
display_name: Test EoL Servers
run_on: ubuntu1804-large
Expand Down Expand Up @@ -424,6 +471,22 @@ tasks:
- func: save-all-artifacts
vars:
compass_distribution: <%= distribution %>
<% } %>

<% for (const distribution of ['compass']) { %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also not looping through COMPASS_DISTRIBUTIONS here yet.

- name: smoketest-<%= distribution %>
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: 'compass-e2e-tests'
- func: smoketest-packaged-app
vars:
mongodb_version: latest-enterprise
compass_distribution: <%= distribution %>
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
<% } %>

<% for (const serverVersion of SERVER_VERSIONS) { %>
Expand Down
23 changes: 23 additions & 0 deletions .evergreen/buildvariants-and-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ buildvariants:
- name: package-compass
- name: package-compass-isolated
- name: package-compass-readonly
- name: smoketest-ubuntu-compass
display_name: Smoketest Ubuntu (compass)
run_on: ubuntu2004-large
depends_on:
- name: package-compass
variant: package-ubuntu
tasks:
- name: smoketest-compass
- name: test-eol-servers
display_name: Test EoL Servers
run_on: ubuntu1804-large
Expand Down Expand Up @@ -472,6 +480,21 @@ tasks:
- func: save-all-artifacts
vars:
compass_distribution: compass-readonly
- name: smoketest-compass
tags:
- required-for-publish
- run-on-pr
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: compass-e2e-tests
- func: smoketest-packaged-app
vars:
mongodb_version: latest-enterprise
compass_distribution: compass
debug: compass-e2e-tests*,electron*,hadron*,mongo*
- name: test-server-40x-community-1
tags:
- required-for-publish
Expand Down
25 changes: 25 additions & 0 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,31 @@ functions:

npm run --unsafe-perm --workspace compass-e2e-tests test-packaged-ci

smoketest-packaged-app:
- command: shell.exec
# Fail the task if it's idle for 10 mins
timeout_secs: 600
params:
working_dir: src
shell: bash
env:
<<: *compass-env
DEBUG: ${debug|}
MONGODB_VERSION: ${mongodb_version|}
MONGODB_RUNNER_VERSION: ${mongodb_version|}
HADRON_DISTRIBUTION: ${compass_distribution}
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)

if [[ "$IS_OSX" == "true" ]]; then
echo "Disabling clipboard usage in e2e tests (TODO: https://jira.mongodb.org/browse/BUILD-14780)"
export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true"
fi

npm run --workspace compass-e2e-tests smoketest

test-web-sandbox:
- command: shell.exec
# Fail the task if it's idle for 10 mins
Expand Down
5 changes: 5 additions & 0 deletions .evergreen/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ echo "NPM_VERSION: $NPM_VERSION"
echo "APPDATA: $APPDATA"
echo "PATH: $PATH"

# these are super useful if you want to run the smoke tests locally
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're going to need these when we want to test with the files produced by a PR or beta or ga build, so I'm just adding it next to other useful/essential variables being output. They aren't secrets so that's fine.

echo "DEV_VERSION_IDENTIFIER: $DEV_VERSION_IDENTIFIER"
echo "EVERGREEN_BUCKET_NAME: $EVERGREEN_BUCKET_NAME"
echo "EVERGREEN_BUCKET_KEY_PREFIX: $EVERGREEN_BUCKET_KEY_PREFIX"

echo "IS_OSX: $IS_OSX"
echo "IS_LINUX: $IS_LINUX"
echo "IS_WINDOWS: $IS_WINDOWS"
Expand Down
1 change: 1 addition & 0 deletions packages/compass-e2e-tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.log
fixtures/*.csv
fixtures/*.json
hadron-build-info.json
3 changes: 2 additions & 1 deletion packages/compass-e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"test-web": "env DEBUG=hadron*,mongo*,compass*,xvfb-maybe* npm run test web",
"test-web-noserver": "env DEBUG=hadron*,mongo*,compass*,xvfb-maybe* npm run test web -- --disable-start-stop --bail",
"coverage-merge": "nyc merge .log/coverage .nyc_output/coverage.json",
"coverage-report": "npm run coverage-merge && nyc report"
"coverage-report": "npm run coverage-merge && nyc report",
"smoketest": "ts-node smoke-test.ts"
},
"devDependencies": {
"@electron/rebuild": "^3.7.1",
Expand Down
Loading
Loading