Skip to content

Commit 4fdd257

Browse files
baileympearsondurrannbbeeken
authored
ci(NODE-5012): break apart mongosh integration tests (#3546) (#3559)
Co-authored-by: Durran Jordan <[email protected]> Co-authored-by: Neal Beeken <[email protected]>
1 parent 20a4fec commit 4fdd257

10 files changed

+396
-67
lines changed

.evergreen/ci_matrix_constants.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const MONGODB_VERSIONS = ['latest', 'rapid', '6.0', '5.0', '4.4', '4.2', '4.0', '3.6'];
2+
const versions = [
3+
{ codeName: 'fermium', versionNumber: 14 },
4+
{ codeName: 'gallium', versionNumber: 16 },
5+
{ codeName: 'hydrogen', versionNumber: 18 }
6+
];
7+
const NODE_VERSIONS = versions.map(({ codeName }) => codeName);
8+
NODE_VERSIONS.sort();
9+
const LOWEST_LTS = NODE_VERSIONS[0];
10+
const LATEST_LTS = NODE_VERSIONS[NODE_VERSIONS.length - 1];
11+
12+
const TOPOLOGIES = ['server', 'replica_set', 'sharded_cluster'];
13+
const AWS_AUTH_VERSIONS = ['latest', '6.0', '5.0', '4.4'];
14+
const TLS_VERSIONS = ['latest', '6.0', '5.0', '4.4', '4.2'];
15+
16+
const DEFAULT_OS = 'rhel80-large';
17+
18+
module.exports = {
19+
MONGODB_VERSIONS,
20+
versions,
21+
NODE_VERSIONS,
22+
LOWEST_LTS,
23+
LATEST_LTS,
24+
TOPOLOGIES,
25+
AWS_AUTH_VERSIONS,
26+
TLS_VERSIONS,
27+
DEFAULT_OS
28+
};

.evergreen/config.in.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,42 @@ functions:
317317
args:
318318
- "${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh"
319319

320-
"run mongosh integration tests":
321-
- command: shell.exec
322-
type: test
320+
###########################################
321+
# mongosh functions
322+
###########################################
323+
"compile mongosh":
324+
- command: subprocess.exec
323325
params:
324-
working_dir: "src"
325-
script: |
326-
${PREPARE_SHELL}
327-
export DISTRO_ID=${distro_id}
328-
bash ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh
326+
working_dir: src
327+
env:
328+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
329+
TASK_ID: ${task_id}
330+
binary: bash
331+
args:
332+
- "${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh"
333+
334+
"run mongosh tests for package":
335+
- command: subprocess.exec
336+
params:
337+
working_dir: src
338+
env:
339+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
340+
TASK_ID: ${task_id}
341+
MONGOSH_RUN_ONLY_IN_PACKAGE: ${mongosh_package}
342+
binary: bash
343+
args:
344+
- "${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh"
345+
346+
"run mongosh package scope test":
347+
- command: subprocess.exec
348+
params:
349+
working_dir: src
350+
env:
351+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
352+
TASK_ID: ${task_id}
353+
binary: bash
354+
args:
355+
- "${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh"
329356

330357
"cleanup":
331358
- command: shell.exec

.evergreen/config.yml

Lines changed: 131 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,37 @@ functions:
281281
binary: bash
282282
args:
283283
- ${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh
284-
run mongosh integration tests:
285-
- command: shell.exec
286-
type: test
284+
compile mongosh:
285+
- command: subprocess.exec
287286
params:
288287
working_dir: src
289-
script: |
290-
${PREPARE_SHELL}
291-
export DISTRO_ID=${distro_id}
292-
bash ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh
288+
env:
289+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
290+
TASK_ID: ${task_id}
291+
binary: bash
292+
args:
293+
- ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh
294+
run mongosh tests for package:
295+
- command: subprocess.exec
296+
params:
297+
working_dir: src
298+
env:
299+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
300+
TASK_ID: ${task_id}
301+
MONGOSH_RUN_ONLY_IN_PACKAGE: ${mongosh_package}
302+
binary: bash
303+
args:
304+
- ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh
305+
run mongosh package scope test:
306+
- command: subprocess.exec
307+
params:
308+
working_dir: src
309+
env:
310+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
311+
TASK_ID: ${task_id}
312+
binary: bash
313+
args:
314+
- ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh
293315
cleanup:
294316
- command: shell.exec
295317
params:
@@ -2339,15 +2361,6 @@ tasks:
23392361
- func: check types
23402362
vars:
23412363
TS_VERSION: 4.1.6
2342-
- name: run-mongosh-integration-tests
2343-
tags:
2344-
- run-mongosh-integration-tests
2345-
exec_timeout_secs: 3600
2346-
commands:
2347-
- func: install dependencies
2348-
vars:
2349-
NODE_LTS_NAME: gallium
2350-
- func: run mongosh integration tests
23512364
- name: download-and-merge-coverage
23522365
tags: []
23532366
commands:
@@ -2809,6 +2822,99 @@ tasks:
28092822
- func: add aws auth variables to file
28102823
- func: setup aws env
28112824
- func: run lambda handler example tests with aws auth
2825+
- name: run-mongosh-browser-repl
2826+
tags:
2827+
- run-mongosh-integration-tests
2828+
depends_on: compile-mongosh
2829+
commands:
2830+
- func: install dependencies
2831+
vars:
2832+
NODE_LTS_NAME: gallium
2833+
- func: run mongosh tests for package
2834+
vars:
2835+
mongosh_package: browser-repl
2836+
- name: run-mongosh-browser-runtime-electron
2837+
tags:
2838+
- run-mongosh-integration-tests
2839+
depends_on: compile-mongosh
2840+
commands:
2841+
- func: install dependencies
2842+
vars:
2843+
NODE_LTS_NAME: gallium
2844+
- func: run mongosh tests for package
2845+
vars:
2846+
mongosh_package: browser-runtime-electron
2847+
- name: run-mongosh-cli-repl
2848+
tags:
2849+
- run-mongosh-integration-tests
2850+
depends_on: compile-mongosh
2851+
commands:
2852+
- func: install dependencies
2853+
vars:
2854+
NODE_LTS_NAME: gallium
2855+
- func: run mongosh tests for package
2856+
vars:
2857+
mongosh_package: cli-repl
2858+
- name: run-mongosh-connectivity-tests
2859+
tags:
2860+
- run-mongosh-integration-tests
2861+
depends_on: compile-mongosh
2862+
commands:
2863+
- func: install dependencies
2864+
vars:
2865+
NODE_LTS_NAME: gallium
2866+
- func: run mongosh tests for package
2867+
vars:
2868+
mongosh_package: connectivity-tests
2869+
- name: run-mongosh-mongosh
2870+
tags:
2871+
- run-mongosh-integration-tests
2872+
depends_on: compile-mongosh
2873+
commands:
2874+
- func: install dependencies
2875+
vars:
2876+
NODE_LTS_NAME: gallium
2877+
- func: run mongosh tests for package
2878+
vars:
2879+
mongosh_package: mongosh
2880+
- name: run-mongosh-node-runtime-worker-thread
2881+
tags:
2882+
- run-mongosh-integration-tests
2883+
depends_on: compile-mongosh
2884+
commands:
2885+
- func: install dependencies
2886+
vars:
2887+
NODE_LTS_NAME: gallium
2888+
- func: run mongosh tests for package
2889+
vars:
2890+
mongosh_package: node-runtime-worker-thread
2891+
- name: run-mongosh-service-provider-server
2892+
tags:
2893+
- run-mongosh-integration-tests
2894+
depends_on: compile-mongosh
2895+
commands:
2896+
- func: install dependencies
2897+
vars:
2898+
NODE_LTS_NAME: gallium
2899+
- func: run mongosh tests for package
2900+
vars:
2901+
mongosh_package: service-provider-server
2902+
- name: compile-mongosh
2903+
tags:
2904+
- run-mongosh-integration-tests
2905+
commands:
2906+
- func: install dependencies
2907+
vars:
2908+
NODE_LTS_NAME: gallium
2909+
- func: compile mongosh
2910+
- name: verify-mongosh-scopes
2911+
tags:
2912+
- run-mongosh-integration-tests
2913+
commands:
2914+
- func: install dependencies
2915+
vars:
2916+
NODE_LTS_NAME: gallium
2917+
- func: run mongosh package scope test
28122918
task_groups:
28132919
- name: serverless_task_group
28142920
setup_group_can_fail_task: true
@@ -3194,7 +3300,15 @@ buildvariants:
31943300
display_name: mongosh integration tests
31953301
run_on: ubuntu1804-large
31963302
tasks:
3197-
- run-mongosh-integration-tests
3303+
- run-mongosh-browser-repl
3304+
- run-mongosh-browser-runtime-electron
3305+
- run-mongosh-cli-repl
3306+
- run-mongosh-connectivity-tests
3307+
- run-mongosh-mongosh
3308+
- run-mongosh-node-runtime-worker-thread
3309+
- run-mongosh-service-provider-server
3310+
- compile-mongosh
3311+
- verify-mongosh-scopes
31983312
- name: ubuntu1804-test-mongodb-aws
31993313
display_name: MONGODB-AWS Auth test
32003314
run_on: ubuntu1804-large

.evergreen/generate_evergreen_tasks.js

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
const fs = require('fs');
22
const yaml = require('js-yaml');
3-
4-
const MONGODB_VERSIONS = ['latest', 'rapid', '6.0', '5.0', '4.4', '4.2', '4.0', '3.6'];
5-
const versions = [
6-
{ codeName: 'fermium', versionNumber: 14 },
7-
{ codeName: 'gallium', versionNumber: 16 },
8-
{ codeName: 'hydrogen', versionNumber: 18 }
9-
];
10-
const NODE_VERSIONS = versions.map(({ codeName }) => codeName);
11-
NODE_VERSIONS.sort();
12-
const LOWEST_LTS = NODE_VERSIONS[0];
13-
const LATEST_LTS = NODE_VERSIONS[NODE_VERSIONS.length - 1];
14-
15-
const TOPOLOGIES = ['server', 'replica_set', 'sharded_cluster'];
16-
const AWS_AUTH_VERSIONS = ['latest', '6.0', '5.0', '4.4'];
17-
const TLS_VERSIONS = ['latest', '6.0', '5.0', '4.4', '4.2'];
18-
19-
const DEFAULT_OS = 'rhel80-large';
3+
const { mongoshTasks } = require('./generate_mongosh_tasks');
4+
5+
const {
6+
MONGODB_VERSIONS,
7+
versions,
8+
NODE_VERSIONS,
9+
LOWEST_LTS,
10+
LATEST_LTS,
11+
TOPOLOGIES,
12+
AWS_AUTH_VERSIONS,
13+
TLS_VERSIONS,
14+
DEFAULT_OS
15+
} = require('./ci_matrix_constants');
2016

2117
const OPERATING_SYSTEMS = [
2218
{
@@ -561,27 +557,11 @@ BUILD_VARIANTS.push({
561557
tasks: ['download-and-merge-coverage']
562558
});
563559

564-
// singleton build variant for mongosh integration tests
565-
SINGLETON_TASKS.push({
566-
name: 'run-mongosh-integration-tests',
567-
tags: ['run-mongosh-integration-tests'],
568-
exec_timeout_secs: 3600,
569-
commands: [
570-
{
571-
func: 'install dependencies',
572-
vars: {
573-
NODE_LTS_NAME: 'gallium'
574-
}
575-
},
576-
{ func: 'run mongosh integration tests' }
577-
]
578-
});
579-
580560
BUILD_VARIANTS.push({
581561
name: 'mongosh_integration_tests',
582562
display_name: 'mongosh integration tests',
583563
run_on: 'ubuntu1804-large',
584-
tasks: ['run-mongosh-integration-tests']
564+
tasks: mongoshTasks.map(({ name }) => name)
585565
});
586566

587567
// special case for MONGODB-AWS authentication
@@ -597,7 +577,7 @@ BUILD_VARIANTS.push({
597577

598578
const oneOffFuncAsTasks = [];
599579

600-
const FLE_PINNED_COMMIT = '77b51c00ab4ff58916dd39f55657e1ecc0af281c'
580+
const FLE_PINNED_COMMIT = '77b51c00ab4ff58916dd39f55657e1ecc0af281c';
601581

602582
for (const version of ['5.0', 'rapid', 'latest']) {
603583
for (const ref of [FLE_PINNED_COMMIT, 'master']) {
@@ -710,7 +690,9 @@ fileData.tasks = (fileData.tasks || [])
710690
.concat(TASKS)
711691
.concat(SINGLETON_TASKS)
712692
.concat(AUTH_DISABLED_TASKS)
713-
.concat(AWS_LAMBDA_HANDLER_TASKS);
693+
.concat(AWS_LAMBDA_HANDLER_TASKS)
694+
.concat(mongoshTasks);
695+
714696
fileData.buildvariants = (fileData.buildvariants || []).concat(BUILD_VARIANTS);
715697

716698
fs.writeFileSync(

0 commit comments

Comments
 (0)