Skip to content

Commit

Permalink
GODRIVER-2916 Clean up Lambda Test Script (#1329)
Browse files Browse the repository at this point in the history
Co-authored-by: Preston Vasquez <[email protected]>
  • Loading branch information
2 people authored and qingyang-hu committed Nov 8, 2023
1 parent 3023774 commit 22bccaf
Showing 1 changed file with 50 additions and 34 deletions.
84 changes: 50 additions & 34 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1184,33 +1184,6 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-fuzz.sh
run-deployed-aws-lambda-tests:
- command: ec2.assume_role
params:
role_arn: ${LAMBDA_AWS_ROLE_ARN}
duration_seconds: 3600
- command: shell.exec
params:
working_dir: src/go.mongodb.org/mongo-driver
shell: bash
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
DRIVERS_ATLAS_PUBLIC_API_KEY: ${DRIVERS_ATLAS_PUBLIC_API_KEY}
DRIVERS_ATLAS_PRIVATE_API_KEY: ${DRIVERS_ATLAS_PRIVATE_API_KEY}
DRIVERS_ATLAS_LAMBDA_USER: ${DRIVERS_ATLAS_LAMBDA_USER}
DRIVERS_ATLAS_LAMBDA_PASSWORD: ${DRIVERS_ATLAS_LAMBDA_PASSWORD}
DRIVERS_ATLAS_GROUP_ID: ${DRIVERS_ATLAS_GROUP_ID}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/internal/test/faas/awslambda
LAMBDA_STACK_NAME: dbx-go-lambda
AWS_REGION: us-east-1
script: |
${PREPARE_SHELL}
.evergreen/run-deployed-lambda-aws-tests.sh
pre:
- func: fetch-source
- func: prepare-resources
Expand Down Expand Up @@ -2279,13 +2252,24 @@ tasks:
- func: bootstrap-mongo-orchestration
- func: run-fuzz-tests

- name: "test-aws-lambda"
tags:
- latest
- lambda
- name: "test-aws-lambda-deployed"
commands:
- func: bootstrap-mongo-orchestration
- func: run-deployed-aws-lambda-tests
- command: ec2.assume_role
params:
role_arn: ${LAMBDA_AWS_ROLE_ARN}
duration_seconds: 3600
- command: shell.exec
params:
working_dir: src/go.mongodb.org/mongo-driver
shell: bash
add_expansions_to_env: true
env:
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/internal/test/faas/awslambda
LAMBDA_STACK_NAME: dbx-go-lambda
AWS_REGION: us-east-1
script: |
${PREPARE_SHELL}
./.evergreen/run-deployed-lambda-aws-tests.sh
axes:
- id: version
Expand Down Expand Up @@ -2611,6 +2595,38 @@ task_groups:
tasks:
- testazurekms-task

- name: test-aws-lambda-task-group
setup_group:
- func: fetch-source
- func: prepare-resources
- command: subprocess.exec
params:
working_dir: src/go.mongodb.org/mongo-driver
binary: bash
add_expansions_to_env: true
env:
LAMBDA_STACK_NAME: dbx-go-lambda
AWS_REGION: us-east-1
args:
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
- command: expansions.update
params:
file: src/go.mongodb.org/mongo-driver/atlas-expansion.yml
teardown_group:
- command: subprocess.exec
params:
working_dir: src/go.mongodb.org/mongo-driver
binary: bash
add_expansions_to_env: true
env:
LAMBDA_STACK_NAME: dbx-go-lambda
AWS_REGION: us-east-1
args:
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800
tasks:
- test-aws-lambda-deployed

buildvariants:
- name: static-analysis
Expand Down Expand Up @@ -2759,7 +2775,7 @@ buildvariants:
matrix_spec: { version: ["latest"], os-faas-80: ["rhel80-large-go-1-20"] }
display_name: "FaaS ${version} ${os-faas-80}"
tasks:
- test-aws-lambda
- test-aws-lambda-task-group

- name: testgcpkms-variant
display_name: "GCP KMS"
Expand Down

0 comments on commit 22bccaf

Please sign in to comment.