-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: run connectivity tests in a docker container (#3087)
* chore: run connectivity tests in a docker container * run test-connectivity on prs * fix paths and add logging * fix dockerfile * replace host gateway with hardcoded ip * run from monorepo root * replace localhost everywhere * try net = host * fix run * switch to 0.0.0.0 * revert unnecessary changes to connect.spec.ts
- Loading branch information
Showing
9 changed files
with
119 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# "bullseye" is the debian distribution that | ||
# ubuntu:20.04 is based on | ||
FROM node:14-bullseye | ||
|
||
COPY .evergreen/connectivity-tests/krb5.conf /etc/krb5.conf | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y \ | ||
krb5-user \ | ||
libsasl2-modules-gssapi-mit \ | ||
ldap-utils \ | ||
libkrb5-dev \ | ||
libsecret-1-dev \ | ||
net-tools \ | ||
libstdc++6 \ | ||
gnome-keyring | ||
|
||
ENV COMPASS_RUN_DOCKER_TESTS="true" | ||
|
||
COPY . /compass-monorepo-root | ||
WORKDIR /compass-monorepo-root | ||
|
||
RUN npm i -g npm@8 | ||
RUN npm run bootstrap-ci | ||
|
||
CMD ["bash", ".evergreen/connectivity-tests/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
echo "---- HOSTS: ----" | ||
cat /etc/hosts | ||
echo "----------------" | ||
|
||
echo "running kinit" | ||
echo 'password' | kinit [email protected] | ||
echo | ||
echo "klist:" | ||
klist | ||
echo | ||
|
||
echo "Running 'npm run test-connectivity --workspace mongodb-data-service' in ${PWD}" | ||
npm run test-connectivity --workspace mongodb-data-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[libdefaults] | ||
default_realm = EXAMPLE.COM | ||
dns_canonicalize_hostname = false | ||
|
||
[realms] | ||
EXAMPLE.COM = { | ||
kdc = localhost | ||
admin_server = localhost | ||
} | ||
|
||
EXAMPLE2.COM = { | ||
kdc = localhost:89 | ||
admin_server = localhost:849 | ||
} | ||
|
||
[domain_realm] | ||
.examplecrossrealm.com = EXAMPLE2.COM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# NOTE: do not -x here there are "env" vars in the commands | ||
set -e | ||
|
||
MONOREPO_ROOT_DIR="$(cd $(dirname "$0")/../..; pwd)" | ||
cd $MONOREPO_ROOT_DIR | ||
|
||
echo "building connectivity tests image from ${PWD}" | ||
docker build -t devtools-connectivity-tests -f "./.evergreen/connectivity-tests/Dockerfile" . | ||
echo "connectivity tests image built" | ||
|
||
echo running connectivity tests image | ||
|
||
docker run \ | ||
--rm \ | ||
-e E2E_TESTS_ATLAS_HOST="${E2E_TESTS_ATLAS_HOST}" \ | ||
-e E2E_TESTS_DATA_LAKE_HOST="${E2E_TESTS_DATA_LAKE_HOST}" \ | ||
-e E2E_TESTS_ANALYTICS_NODE_HOST="${E2E_TESTS_ANALYTICS_NODE_HOST}" \ | ||
-e E2E_TESTS_SERVERLESS_HOST="${E2E_TESTS_SERVERLESS_HOST}" \ | ||
-e E2E_TESTS_FREE_TIER_HOST="${E2E_TESTS_FREE_TIER_HOST}" \ | ||
-e E2E_TESTS_ATLAS_USERNAME="${E2E_TESTS_ATLAS_USERNAME}" \ | ||
-e E2E_TESTS_ATLAS_PASSWORD="${E2E_TESTS_ATLAS_PASSWORD}" \ | ||
-e E2E_TESTS_ATLAS_X509_PEM="${E2E_TESTS_ATLAS_X509_PEM}" \ | ||
-e MONGODB_VERSION="${MONGODB_VERSION}" \ | ||
--add-host mongodb-kerberos-1.example.com:0.0.0.0 \ | ||
--add-host mongodb-kerberos-2.example.com:0.0.0.0 \ | ||
--add-host mongodb-kerberos-3.examplecrossrealm.com:0.0.0.0 \ | ||
--network host \ | ||
devtools-connectivity-tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.