Skip to content

Commit c9fdaf2

Browse files
durranmalikj2000
authored andcommitted
ci(NODE-5361): use task groups for lambda (#3740)
1 parent 1bad8a0 commit c9fdaf2

File tree

3 files changed

+99
-68
lines changed

3 files changed

+99
-68
lines changed

.evergreen/config.in.yml

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,31 +182,6 @@ functions:
182182
PROJECT_DIRECTORY="${PROJECT_DIRECTORY}" \
183183
bash ${PROJECT_DIRECTORY}/.evergreen/run-oidc-tests.sh
184184
185-
"run deployed aws lambda tests":
186-
- command: ec2.assume_role
187-
params:
188-
role_arn: ${LAMBDA_AWS_ROLE_ARN}
189-
duration_seconds: 3600
190-
- command: subprocess.exec
191-
params:
192-
working_dir: src
193-
binary: bash
194-
args:
195-
- .evergreen/run-deployed-lambda-aws-tests.sh
196-
env:
197-
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda
198-
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
199-
DRIVERS_ATLAS_PUBLIC_API_KEY: ${DRIVERS_ATLAS_PUBLIC_API_KEY}
200-
DRIVERS_ATLAS_PRIVATE_API_KEY: ${DRIVERS_ATLAS_PRIVATE_API_KEY}
201-
DRIVERS_ATLAS_LAMBDA_USER: ${DRIVERS_ATLAS_LAMBDA_USER}
202-
DRIVERS_ATLAS_LAMBDA_PASSWORD: ${DRIVERS_ATLAS_LAMBDA_PASSWORD}
203-
DRIVERS_ATLAS_GROUP_ID: ${DRIVERS_ATLAS_GROUP_ID}
204-
LAMBDA_STACK_NAME: dbx-node-lambda
205-
AWS_REGION: us-east-1
206-
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
207-
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
208-
AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
209-
210185
"run tests":
211186
- command: shell.exec
212187
type: test
@@ -1280,6 +1255,24 @@ tasks:
12801255
args:
12811256
- .evergreen/run-oidc-tests-azure.sh
12821257

1258+
- name: "test-aws-lambda-deployed"
1259+
commands:
1260+
- func: "install dependencies"
1261+
- command: ec2.assume_role
1262+
params:
1263+
role_arn: ${LAMBDA_AWS_ROLE_ARN}
1264+
duration_seconds: 3600
1265+
- command: subprocess.exec
1266+
params:
1267+
working_dir: src
1268+
binary: bash
1269+
add_expansions_to_env: true
1270+
args:
1271+
- ${DRIVERS_TOOLS}/.evergreen/aws_lambda/run-deployed-lambda-aws-tests.sh
1272+
env:
1273+
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda
1274+
AWS_REGION: us-east-1
1275+
12831276
task_groups:
12841277
- name: serverless_task_group
12851278
setup_group_can_fail_task: true
@@ -1411,6 +1404,32 @@ task_groups:
14111404
tasks:
14121405
- oidc-auth-test-azure-latest
14131406

1407+
- name: test_atlas_task_group
1408+
setup_group:
1409+
- func: fetch source
1410+
- command: subprocess.exec
1411+
params:
1412+
working_dir: src
1413+
binary: bash
1414+
add_expansions_to_env: true
1415+
args:
1416+
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
1417+
- command: expansions.update
1418+
params:
1419+
file: src/atlas-expansion.yml
1420+
teardown_group:
1421+
- command: subprocess.exec
1422+
params:
1423+
working_dir: src
1424+
binary: bash
1425+
add_expansions_to_env: true
1426+
args:
1427+
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
1428+
setup_group_can_fail_task: true
1429+
setup_group_timeout_secs: 1800
1430+
tasks:
1431+
- test-aws-lambda-deployed
1432+
14141433
pre:
14151434
- func: "fetch source"
14161435
- func: "windows fix"

.evergreen/config.yml

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,6 @@ functions:
151151
AWS_WEB_IDENTITY_TOKEN_FILE="/tmp/tokens/test_user1" \
152152
PROJECT_DIRECTORY="${PROJECT_DIRECTORY}" \
153153
bash ${PROJECT_DIRECTORY}/.evergreen/run-oidc-tests.sh
154-
run deployed aws lambda tests:
155-
- command: ec2.assume_role
156-
params:
157-
role_arn: ${LAMBDA_AWS_ROLE_ARN}
158-
duration_seconds: 3600
159-
- command: subprocess.exec
160-
params:
161-
working_dir: src
162-
binary: bash
163-
args:
164-
- .evergreen/run-deployed-lambda-aws-tests.sh
165-
env:
166-
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda
167-
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
168-
DRIVERS_ATLAS_PUBLIC_API_KEY: ${DRIVERS_ATLAS_PUBLIC_API_KEY}
169-
DRIVERS_ATLAS_PRIVATE_API_KEY: ${DRIVERS_ATLAS_PRIVATE_API_KEY}
170-
DRIVERS_ATLAS_LAMBDA_USER: ${DRIVERS_ATLAS_LAMBDA_USER}
171-
DRIVERS_ATLAS_LAMBDA_PASSWORD: ${DRIVERS_ATLAS_LAMBDA_PASSWORD}
172-
DRIVERS_ATLAS_GROUP_ID: ${DRIVERS_ATLAS_GROUP_ID}
173-
LAMBDA_STACK_NAME: dbx-node-lambda
174-
AWS_REGION: us-east-1
175-
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
176-
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
177-
AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
178154
run tests:
179155
- command: shell.exec
180156
type: test
@@ -1203,6 +1179,23 @@ tasks:
12031179
PROVIDER_NAME: azure
12041180
args:
12051181
- .evergreen/run-oidc-tests-azure.sh
1182+
- name: test-aws-lambda-deployed
1183+
commands:
1184+
- func: install dependencies
1185+
- command: ec2.assume_role
1186+
params:
1187+
role_arn: ${LAMBDA_AWS_ROLE_ARN}
1188+
duration_seconds: 3600
1189+
- command: subprocess.exec
1190+
params:
1191+
working_dir: src
1192+
binary: bash
1193+
add_expansions_to_env: true
1194+
args:
1195+
- ${DRIVERS_TOOLS}/.evergreen/aws_lambda/run-deployed-lambda-aws-tests.sh
1196+
env:
1197+
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda
1198+
AWS_REGION: us-east-1
12061199
- name: test-latest-server
12071200
tags:
12081201
- latest
@@ -3140,13 +3133,6 @@ tasks:
31403133
VERSION: rapid
31413134
TOPOLOGY: server
31423135
- func: run lambda handler example tests
3143-
- name: test-deployed-lambda
3144-
tags:
3145-
- latest
3146-
- lambda
3147-
commands:
3148-
- func: install dependencies
3149-
- func: run deployed aws lambda tests
31503136
- name: test-lambda-aws-auth-example
31513137
tags:
31523138
- latest
@@ -3471,6 +3457,31 @@ task_groups:
34713457
setup_group_timeout_secs: 1800
34723458
tasks:
34733459
- oidc-auth-test-azure-latest
3460+
- name: test_atlas_task_group
3461+
setup_group:
3462+
- func: fetch source
3463+
- command: subprocess.exec
3464+
params:
3465+
working_dir: src
3466+
binary: bash
3467+
add_expansions_to_env: true
3468+
args:
3469+
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
3470+
- command: expansions.update
3471+
params:
3472+
file: src/atlas-expansion.yml
3473+
teardown_group:
3474+
- command: subprocess.exec
3475+
params:
3476+
working_dir: src
3477+
binary: bash
3478+
add_expansions_to_env: true
3479+
args:
3480+
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
3481+
setup_group_can_fail_task: true
3482+
setup_group_timeout_secs: 1800
3483+
tasks:
3484+
- test-aws-lambda-deployed
34743485
pre:
34753486
- func: fetch source
34763487
- func: windows fix
@@ -4055,6 +4066,11 @@ buildvariants:
40554066
batchtime: 20160
40564067
tasks:
40574068
- testazureoidc_task_group
4069+
- name: rhel8-test-atlas
4070+
display_name: Atlas Cluster Tests
4071+
run_on: rhel80-large
4072+
tasks:
4073+
- test_atlas_task_group
40584074
- name: rhel8-no-auth-tests
40594075
display_name: No Auth Tests
40604076
run_on: rhel80-large
@@ -4094,7 +4110,6 @@ buildvariants:
40944110
tasks:
40954111
- test-lambda-example
40964112
- test-lambda-aws-auth-example
4097-
- test-deployed-lambda
40984113
- name: rhel8-test-seach-index-management-helpers
40994114
display_name: Search Index Management Helpers Tests
41004115
run_on: rhel80-large

.evergreen/generate_evergreen_tasks.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,6 @@ AWS_LAMBDA_HANDLER_TASKS.push({
302302
]
303303
});
304304

305-
// Add the deployed lambda function tests.
306-
AWS_LAMBDA_HANDLER_TASKS.push({
307-
name: 'test-deployed-lambda',
308-
tags: ['latest', 'lambda'],
309-
commands: [
310-
{ func: 'install dependencies' },
311-
{ func: 'run deployed aws lambda tests' }
312-
]
313-
});
314-
315305
// Add task for testing lambda example with aws auth.
316306
AWS_LAMBDA_HANDLER_TASKS.push({
317307
name: 'test-lambda-aws-auth-example',
@@ -763,6 +753,13 @@ BUILD_VARIANTS.push({
763753
tasks: ['testazureoidc_task_group']
764754
});
765755

756+
BUILD_VARIANTS.push({
757+
name: 'rhel8-test-atlas',
758+
display_name: 'Atlas Cluster Tests',
759+
run_on: DEFAULT_OS,
760+
tasks: ['test_atlas_task_group']
761+
});
762+
766763
BUILD_VARIANTS.push({
767764
name: 'rhel8-no-auth-tests',
768765
display_name: 'No Auth Tests',
@@ -777,7 +774,7 @@ BUILD_VARIANTS.push({
777774
name: 'rhel8-test-lambda',
778775
display_name: 'AWS Lambda handler tests',
779776
run_on: DEFAULT_OS,
780-
tasks: ['test-lambda-example', 'test-lambda-aws-auth-example', 'test-deployed-lambda']
777+
tasks: ['test-lambda-example', 'test-lambda-aws-auth-example']
781778
});
782779

783780
BUILD_VARIANTS.push({

0 commit comments

Comments
 (0)