-
Notifications
You must be signed in to change notification settings - Fork 68
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
DRIVERS-2328 Add more explicit AWS test instructions #375
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,4 +1,64 @@ | ||
# Configuration Scripts for End-to-end Testing | ||
|
||
These scripts were taken from [mongo-enterprise-modules](https://github.com/10gen/mongo-enterprise-modules/tree/master/jstests/external_auth_aws) | ||
and intended to simplify creating users, attaching roles to existing EC2 instances, launching an Amazon ECS container instance, etc. | ||
These scripts were originally taken from [mongo-enterprise-modules](https://github.com/10gen/mongo-enterprise-modules/tree/master/jstests/external_auth_aws) | ||
and intended to simplify creating users, attaching roles to existing EC2 instances, launching an Amazon ECS container instance, etc. | ||
|
||
## Test Process | ||
|
||
For all testing variants except for ECS, the general test flow is: | ||
|
||
- Set up the required secrets for the the test variant: | ||
|
||
```bash | ||
cd $DRIVERS_TOOLS/.evergreen/auth_aws | ||
# Fetch the secrets from the vault and write to a local `secrets-export.sh` file. | ||
bash setup_secrets.sh drivers/aws_auth | ||
``` | ||
|
||
See https://wiki.corp.mongodb.com/display/DRIVERS/Using+AWS+Secrets+Manager+to+Store+Testing+Secrets for more background | ||
on how the secrets are managed. | ||
|
||
- Run the setup for the test variant and then run your specific tests. | ||
|
||
```bash | ||
cd $DRIVERS_TOOLS/.evergreen/auth_aws | ||
# Create a python virtual environment. | ||
cd ./activate-authawsvenv.sh | ||
# Source the environment variables. | ||
. aws_setup.sh <variant> | ||
# Configure the environment and the server. | ||
python aws_tester.py <variant> | ||
# Run your driver-specific tests here. | ||
``` | ||
|
||
It is recommended that these actions be broken into scripts that can be run locally as well as in CI. The instructions | ||
for setting up local secrets handling are in the wiki page. | ||
|
||
## ECS Test Process | ||
|
||
The ECS test variant requires a slightly different approach, since we need to run the code in a container. | ||
|
||
Set up a `run-mongodb-aws-ecs-test.sh` script that will run on the container. This script should be | ||
copied to `${DRIVERS_TOOLS}/.evergreen/auth_aws/src/.evergreen`. The driver code and test code should | ||
be compiled if necessary, and then compressed into a `src.tgz` file that will be expanded and used in | ||
the container. | ||
|
||
```bash | ||
# Set up the target directory. | ||
ECS_SRC_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws/src | ||
mkdir -p $ECS_SRC_DIR/.evergreen | ||
# Move the test script to the correct location. | ||
cp ${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen | ||
# Driver-specific - compile/build code if needed. | ||
# Driver-specific - move artifacts needed for test to $ECS_SRC_DIR | ||
# Run the test | ||
PROJECT_DIRECTORY="$ECS_SRC_DIR" $AUTH_AWS_DIR/aws_setup.sh ecs | ||
``` | ||
|
||
## Deprecated Scripts | ||
|
||
The top-level JavaScript files in this directory are deprecated and no longer needed when | ||
using the instructions above. They use the legacy `mongo` shell. | ||
Additionally, it is not longer required to create | ||
an `aws_e2e_setup.json` file using Evergreen project variables. The variables are | ||
single-sourced from AWS Secrets Manager. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we already have these broken up into scripts? If so, we could link to them here as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not, no, that is part of a broader effort and what the EVG docs recommend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth opening a ticket to track that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://jira.mongodb.org/browse/PYTHON-4069