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
56 changes: 56 additions & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,46 @@ functions:

DEBUG=${debug} MONGODB_VERSION=${mongodb_version|4} npm run --unsafe-perm --workspace compass-e2e-tests test-packaged-ci

test-connectivity:
- 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
COMPASS_SKIP_KERBEROS_TESTS: 'true'
COMPASS_RUN_DOCKER_TESTS: 'true'
Comment on lines +316 to +317
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not the other ones though? env supports evergreen expansions. But it's a total nit, so feel free to ignore

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Didn't know that, let's move them, is not like that though rn in other functions, I'll try and see what happens i guess, if it works i'll move also the rest

DEBUG: ${debug}
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)

git clone -b v1.2.4 https://github.com/mongodb-js/devtools-docker-test-envs.git test-envs
docker-compose -f test-envs/docker/enterprise/docker-compose.yaml up -d
docker-compose -f test-envs/docker/ldap/docker-compose.yaml up -d
docker-compose -f test-envs/docker/scram/docker-compose.yaml up -d
docker-compose -f test-envs/docker/sharded/docker-compose.yaml up -d
docker-compose -f test-envs/docker/ssh/docker-compose.yaml up -d
docker-compose -f test-envs/docker/tls/docker-compose.yaml up -d
docker-compose -f test-envs/docker/kerberos/docker-compose.yaml up -d

stop_all_docker_containers() {
docker-compose -f test-envs/docker/enterprise/docker-compose.yaml down -v --remove-orphans
docker-compose -f test-envs/docker/ldap/docker-compose.yaml down -v --remove-orphans
docker-compose -f test-envs/docker/scram/docker-compose.yaml down -v --remove-orphans
docker-compose -f test-envs/docker/sharded/docker-compose.yaml down -v --remove-orphans
docker-compose -f test-envs/docker/ssh/docker-compose.yaml down -v --remove-orphans
docker-compose -f test-envs/docker/tls/docker-compose.yaml down -v --remove-orphans
docker-compose -f test-envs/docker/kerberos/docker-compose.yaml down -v --remove-orphans
}

trap "stop_all_docker_containers" ERR
npm run test-connectivity --workspace mongodb-data-service
stop_all_docker_containers

save-windows-artifacts:
- <<: *save-artifact
params:
Expand Down Expand Up @@ -523,6 +563,16 @@ tasks:
compass_distribution: compass-readonly
variants: [ubuntu]

- name: test-connectivity
tags: ['required-for-publish']
commands:
- func: prepare
- func: install
- func: bootstrap
- func: test-connectivity
vars:
debug: 'compass*,electron*,hadron*,mongo*'

# copied as test-packaged-app-macos due to depends_on variation
- name: test-packaged-app
tags: ['required-for-publish']
Expand Down Expand Up @@ -712,6 +762,12 @@ buildvariants:
# everything in one go
- name: publish

- name: ubuntu_connectivity_tests
display_name: Connectivity Tests
run_on: ubuntu1604-large
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since ubuntu 16.04 has already been EOL for almost a year and this is dockerized anyway, could we maybe use a newer distro like 20.04 here? I assume the build team will be interested in removing 16.04 support at some point

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

tasks:
- name: test-connectivity

- name: rhel
display_name: RHEL
run_on: rhel76-large
Expand Down
1 change: 1 addition & 0 deletions packages/data-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"check-ci": "npm run check",
"pretest": "mongodb-runner start --port=27018 && node ../../scripts/rebuild.js keytar",
"test": "mocha",
"test-connectivity": "mocha ./src/connect.spec.ts",
"posttest": "mongodb-runner stop --port=27018",
"test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",
"test-watch": "npm run test -- --watch",
Expand Down
6 changes: 6 additions & 0 deletions packages/data-service/src/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ describe('connect', function () {
});

describe('kerberos', function () {
before(function () {
if (process.env.COMPASS_SKIP_KERBEROS_TESTS === 'true') {
this.skip();
}
});

it('connects to kerberos', async function () {
await testConnection(envs.getConnectionOptions('kerberos'), {
authenticatedUserRoles: [
Expand Down