-
Notifications
You must be signed in to change notification settings - Fork 65
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
test(DRIVERS-2657): break out lambda scripts #325
Conversation
Co-authored-by: Bailey Pearson <[email protected]>
Does the lambda stack deletion need to be part of teardown as well? |
# DRIVERS_ATLAS_PRIVATE_API_KEY: The private Atlas key for the drivers org. | ||
# DRIVERS_ATLAS_GROUP_ID: The id of the individual projects under the drivers org, per language. | ||
# LAMBDA_STACK_NAME: The name of the stack on lambda "dbx-<language>-lambda" | ||
# AWS_REGION: The region for the function - generally us-east-1 |
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.
Although this script appears to be specifically written to run after the "setup-atlas-cluster", since we are breaking it out can we include the "MONGODB_URI" in the list of required environment variables?
I think it would be useful to note this, in the case an engineer wants to run the tests locally i.e.
PROJECT_DIRECTORY="mongo-go-driver"
DRIVERS_TOOLS="drivers-evergreen-tools"
# Change the directory to DRIVERS_TOOLS
cd $DRIVERS_TOOLS
TEST_LAMBDA_DIRECTORY="$PROJECT_DIRECTORY/internal/test/faas/awslambda" \
DRIVERS_ATLAS_PUBLIC_API_KEY="" \
DRIVERS_ATLAS_PRIVATE_API_KEY="" \
DRIVERS_ATLAS_GROUP_ID="" \
LAMBDA_STACK_NAME="dbx-go-lambda" \
MONGODB_URI="mongodb://localhost:27017" \
AWS_REGION="us-east-1" \
. .evergreen/aws_lambda/run-deployed-lambda-aws-tests.sh
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.
Added MONGODB_URI
as a required env variable in the comments.
|
||
# The base Atlas API url. We use the API directly as the CLI does not yet | ||
# support testing cluster outages. | ||
ATLAS_BASE_URL="https://cloud.mongodb.com/api/atlas/v1.0" |
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.
Should we decouple the version in the ATLAS_BASE_URL?
ATLAS_BASE_URL="https://cloud.mongodb.com/api/atlas/v1.0" | |
ATLAS_API_VERSION="v.10" | |
ATLAS_BASE_URL="https://cloud.mongodb.com/api/atlas/$ATLAS_API_VERSION" |
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.
Done.
|
||
# The base Atlas API url. We use the API directly as the CLI does not yet | ||
# support testing cluster outages. | ||
ATLAS_BASE_URL="https://cloud.mongodb.com/api/atlas/v1.0" |
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.
Should we decouple the version in the ATLAS_BASE_URL?
ATLAS_BASE_URL="https://cloud.mongodb.com/api/atlas/v1.0" | |
ATLAS_API_VERSION="v.10" | |
ATLAS_BASE_URL="https://cloud.mongodb.com/api/atlas/$ATLAS_API_VERSION" |
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.
Done.
@blink1073 I didn't split out lambda cloud formation deploy/delete into their own setup/teardown as I wanted it to be apparent in the main task that it was a lambda flow with the assume role and running of the script, with the atlas related tasks being split out. I can split those out as well if you feel strongly about it. |
Co-authored-by: Andreas Braun <[email protected]>
Breaks out the scripts that run the lambda tests into multiple scripts, with the atlas create/delete cluster scripts broken out so that they can be run in setup/teardown on evergreen task groups.
Node.js impl: mongodb/node-mongodb-native#3740
Spec changes: mongodb/specifications#1438
Original script: For context, the original script is https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-deployed-lambda-aws-tests.sh
Example evergreen config: