Skip to content
Open
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
3 changes: 3 additions & 0 deletions .evergreen/run-mongodb-aws-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ source .evergreen/setup-mongodb-aws-auth-tests.sh
# load node.js environment
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh

# clear AWS_PROFILE, so it doesn't interfere with env-creds
unset AWS_PROFILE

npm run check:aws
33 changes: 33 additions & 0 deletions etc/run-aws-integ-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euxo pipefail # Exit on error, undefined variable, and fail on pipe errors

# NOTE: This script assumes that you've created an AWS SSO session already, as outlined in
# ./test/readme.md, section `AWS Profile`, and you have an AWS profile
# named `drivers-test-secrets-role-857654397073` in your AWS config.

# Choose credential type: env-creds or session-creds
# export AWS_CREDENTIAL_TYPE="env-creds"
export AWS_CREDENTIAL_TYPE="session-creds"
export VERSION="latest"
export NODE_LTS_VERSION="24"
export AUTH="auth"
export ORCHESTRATION_FILE="auth-aws.json"
export TOPOLOGY="server"
export NODE_DRIVER="$DRIVERS_TOOLS/.."
export AWS_PROFILE="drivers-test-secrets-role-857654397073"

# Enable for verbose logging
# export MONGODB_LOG_ALL="debug"
# export MONGODB_LOG_PATH="stderr"

echo "Assuming AWS SSO role..."
aws sso login --sso-session drivers-test-secrets-session

echo "Installing dependencies..."
bash ${NODE_DRIVER}/.evergreen/install-dependencies.sh

echo "Bootstrapping orchestration..."
bash ${NODE_DRIVER}/.evergreen/run-orchestration.sh

echo "Running AWS integration tests with env-creds from $NODE_DRIVER ..."
bash ${NODE_DRIVER}/.evergreen/run-mongodb-aws-test.sh
28 changes: 28 additions & 0 deletions test/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ about the types of tests and how to run them.
- [Deployed Lambda Tests](#deployed-lambda-tests)
- [Kerberos Tests](#kerberos-tests)
- [AWS Authentication tests](#aws-authentication-tests)
- [AWS Profile](#aws-profile)
- [Container Tests](#container-tests)
- [GCP](#gcp)
- [Azure](#azure)
Expand Down Expand Up @@ -647,6 +648,33 @@ Choose your AWS authentication credential type and export the `AWS_CREDENTIAL_TY

1. Run the `bash .evergreen/run-mongodb-aws-tests.sh`.

An example of performing the above is [`etc/run-aws-integ-tests.sh`](etc/run-aws-integ-tests.sh).

#### AWS Profile

Setup an AWS_PROFILE locally to be able to use AWS and to run AWS tests locally.

1. Get SSO sign-in info from AWS
1. Navigate to https://corp.mongodb.com/app/UserHome
2. Open AWS
3. Choose `Drivers` account
4. Choose `drivers-test-secrets-role`
5. Click `Access Keys`
6. Copy down `SSO start URL` and `SSO Region`
2. Sign in locally
1. Run `aws configure sso-session`
2. Pick a name, like `drivers-test-secrets-session`
3. Specify `SSO start URL` and `SSO Region` from earlier steps
3. Add a profile
1. Add the following profile to `~/.aws/config`

```ini
[profile drivers-test-secrets-role-857654397073]
sso_session = drivers-test-secrets-session
sso_account_id = 857654397073
sso_role_name = drivers-test-secrets-role
```

### Container Tests

It may become required to run tests or debug code inside a live Azure or GCP container. The best way to do this is to leverage
Expand Down