@@ -6,10 +6,10 @@ const yaml = require('js-yaml');
6
6
7
7
const LATEST_EFFECTIVE_VERSION = '5.0' ;
8
8
const LEGACY_MONGODB_VERSIONS = new Set ( [ '4.4' , '4.2' , '4.0' , '3.6' , '3.4' , '3.2' , '3.0' , '2.6' ] ) ;
9
- const MONGODB_VERSIONS = [ 'latest' ] . concat ( Array . from ( LEGACY_MONGODB_VERSIONS ) ) ;
10
- const AWS_AUTH_VERSIONS = [ 'latest' , '4.4' ] ;
11
- const OCSP_VERSIONS = [ 'latest' , '4.4' ] ;
12
- const TLS_VERSIONS = [ 'latest' , '4.2' ] ; // also test on 4.2 because 4.4+ currently skipped on windows
9
+ const MONGODB_VERSIONS = [ 'latest' , '5.0' ] . concat ( Array . from ( LEGACY_MONGODB_VERSIONS ) ) ;
10
+ const AWS_AUTH_VERSIONS = [ 'latest' , '5.0' , ' 4.4'] ;
11
+ const OCSP_VERSIONS = [ 'latest' , '5.0' , ' 4.4'] ;
12
+ const TLS_VERSIONS = [ 'latest' , '5.0' , ' 4.2'] ; // also test on 4.2 because 4.4+ currently skipped on windows
13
13
const NODE_VERSIONS = [ 'fermium' , 'erbium' , 'dubnium' , 'carbon' , 'boron' , 'argon' ] ;
14
14
const LEGACY_TOPOLOGIES = new Set ( [ 'server' , 'replica_set' , 'sharded_cluster' ] ) ;
15
15
const UNIFIED_TOPOLOGIES = Array . from ( LEGACY_TOPOLOGIES ) . map ( topology => `${ topology } -unified` ) ;
@@ -154,7 +154,8 @@ TASKS.push(
154
154
tags : [ 'auth' , 'kerberos' , 'legacy' ] ,
155
155
commands : [
156
156
{ func : 'install dependencies' } ,
157
- { func : 'run kerberos tests' ,
157
+ {
158
+ func : 'run kerberos tests' ,
158
159
vars : {
159
160
UNIFIED : 0
160
161
}
@@ -166,7 +167,8 @@ TASKS.push(
166
167
tags : [ 'auth' , 'kerberos' , 'unified' ] ,
167
168
commands : [
168
169
{ func : 'install dependencies' } ,
169
- { func : 'run kerberos tests' ,
170
+ {
171
+ func : 'run kerberos tests' ,
170
172
vars : {
171
173
UNIFIED : 1
172
174
}
@@ -325,7 +327,7 @@ OCSP_VERSIONS.forEach(VERSION => {
325
327
const AWS_AUTH_TASKS = [ ] ;
326
328
327
329
AWS_AUTH_VERSIONS . forEach ( VERSION => {
328
- const name = ( ex ) => `aws-${ VERSION } -auth-test-${ ex . split ( ' ' ) . join ( '-' ) } ` ;
330
+ const name = ex => `aws-${ VERSION } -auth-test-${ ex . split ( ' ' ) . join ( '-' ) } ` ;
329
331
// AWS_AUTH_TASKS.push(name);
330
332
331
333
const aws_funcs = [
@@ -354,10 +356,10 @@ AWS_AUTH_VERSIONS.forEach(VERSION => {
354
356
{ func : 'setup aws env' } ,
355
357
fn
356
358
]
357
- } ) )
359
+ } ) ) ;
358
360
359
361
TASKS . push ( ...aws_tasks ) ;
360
- AWS_AUTH_TASKS . push ( ...aws_tasks . map ( t => t . name ) )
362
+ AWS_AUTH_TASKS . push ( ...aws_tasks . map ( t => t . name ) ) ;
361
363
} ) ;
362
364
363
365
const BUILD_VARIANTS = [ ] ;
@@ -371,31 +373,33 @@ const getTaskList = (() => {
371
373
return memo [ key ] ;
372
374
}
373
375
const taskList = BASE_TASKS . concat ( TASKS ) ;
374
- const ret = taskList . filter ( task => {
375
- if ( task . name . match ( / ^ a w s / ) ) return false ;
376
+ const ret = taskList
377
+ . filter ( task => {
378
+ if ( task . name . match ( / ^ a w s / ) ) return false ;
376
379
377
- // skip unsupported tasks on windows
378
- if ( os . match ( / ^ w i n d o w s / ) && task . tags . filter ( tag => WINDOWS_SKIP_TAGS . has ( tag ) ) . length ) {
379
- return false ;
380
- }
380
+ // skip unsupported tasks on windows
381
+ if ( os . match ( / ^ w i n d o w s / ) && task . tags . filter ( tag => WINDOWS_SKIP_TAGS . has ( tag ) ) . length ) {
382
+ return false ;
383
+ }
381
384
382
- const tasksWithVars = task . commands . filter ( task => ! ! task . vars ) ;
383
- if ( ! tasksWithVars . length ) {
384
- return true ;
385
- }
385
+ const tasksWithVars = task . commands . filter ( task => ! ! task . vars ) ;
386
+ if ( ! tasksWithVars . length ) {
387
+ return true ;
388
+ }
386
389
387
- // kerberos tests don't require mongo orchestration
388
- if ( task . tags . filter ( tag => tag === 'kerberos' ) . length ) {
389
- return true ;
390
- }
390
+ // kerberos tests don't require mongo orchestration
391
+ if ( task . tags . filter ( tag => tag === 'kerberos' ) . length ) {
392
+ return true ;
393
+ }
391
394
392
- const { VERSION } = tasksWithVars [ 0 ] . vars || { } ;
393
- if ( VERSION === 'latest' ) {
394
- return semver . satisfies ( semver . coerce ( LATEST_EFFECTIVE_VERSION ) , mongoVersion ) ;
395
- }
395
+ const { VERSION } = tasksWithVars [ 0 ] . vars || { } ;
396
+ if ( VERSION === 'latest' ) {
397
+ return semver . satisfies ( semver . coerce ( LATEST_EFFECTIVE_VERSION ) , mongoVersion ) ;
398
+ }
396
399
397
- return semver . satisfies ( semver . coerce ( VERSION ) , mongoVersion ) ;
398
- } ) . map ( x => x . name ) ;
400
+ return semver . satisfies ( semver . coerce ( VERSION ) , mongoVersion ) ;
401
+ } )
402
+ . map ( x => x . name ) ;
399
403
400
404
memo [ key ] = ret ;
401
405
return ret ;
@@ -448,38 +452,48 @@ SINGLETON_TASKS.push({
448
452
]
449
453
} ) ;
450
454
451
- SINGLETON_TASKS . push ( {
452
- name : 'run-custom-csfle-tests' ,
453
- tags : [ 'run-custom-csfle-tests' ] ,
455
+ const oneOffFuncs = [
456
+ { func : 'run custom csfle tests' , vars : { UNIFIED : 1 , NODE_LTS_NAME : 'erbium' } } ,
457
+ { func : 'run custom snappy tests' , vars : { UNIFIED : 1 , NODE_LTS_NAME : 'erbium' } }
458
+ ] ;
459
+
460
+ const oneOffFuncAsTasks = oneOffFuncs . map ( oneOffFunc => ( {
461
+ name : `${ oneOffFunc . func . split ( ' ' ) . join ( '-' ) } ` ,
462
+ tags : [ 'run-custom-dependency-tests' ] ,
454
463
commands : [
455
464
{
456
465
func : 'install dependencies' ,
457
466
vars : {
458
- NODE_LTS_NAME : 'erbium' ,
459
- } ,
467
+ NODE_LTS_NAME : 'erbium'
468
+ }
460
469
} ,
461
470
{
462
471
func : 'bootstrap mongo-orchestration' ,
463
472
vars : {
464
- VERSION : '4.4 ' ,
473
+ VERSION : '5.0 ' ,
465
474
TOPOLOGY : 'server'
466
475
}
467
476
} ,
468
- { func : 'run custom csfle tests' }
477
+ oneOffFunc
469
478
]
470
- } ) ;
479
+ } ) ) ;
471
480
472
- BUILD_VARIANTS . push ( {
473
- name : 'lint' ,
474
- display_name : 'lint' ,
475
- run_on : 'rhel70' ,
476
- tasks : [ 'run-checks' ]
477
- } , {
478
- name : 'ubuntu1804-custom-csfle-tests' ,
479
- display_name : 'Custom FLE Version Test' ,
480
- run_on : 'ubuntu1804-test' ,
481
- tasks : [ 'run-custom-csfle-tests' ]
482
- } ) ;
481
+ SINGLETON_TASKS . push ( ...oneOffFuncAsTasks ) ;
482
+
483
+ BUILD_VARIANTS . push (
484
+ {
485
+ name : 'lint' ,
486
+ display_name : 'lint' ,
487
+ run_on : 'rhel70' ,
488
+ tasks : [ 'run-checks' ]
489
+ } ,
490
+ {
491
+ name : 'ubuntu1804-custom-dependency-tests' ,
492
+ display_name : 'Custom Dependency Version Test' ,
493
+ run_on : 'ubuntu1804-large' ,
494
+ tasks : oneOffFuncAsTasks . map ( ( { name } ) => name )
495
+ }
496
+ ) ;
483
497
484
498
// special case for MONGODB-AWS authentication
485
499
BUILD_VARIANTS . push ( {
@@ -493,7 +507,7 @@ BUILD_VARIANTS.push({
493
507
} ) ;
494
508
495
509
const fileData = yaml . safeLoad ( fs . readFileSync ( `${ __dirname } /config.yml.in` , 'utf8' ) ) ;
496
- fileData . tasks = ( fileData . tasks || [ ] ) . concat ( BASE_TASKS ) . concat ( TASKS ) . concat ( SINGLETON_TASKS ) ;
510
+ fileData . tasks = ( fileData . tasks || [ ] ) . concat ( BASE_TASKS , TASKS , SINGLETON_TASKS ) ;
497
511
fileData . buildvariants = ( fileData . buildvariants || [ ] ) . concat ( BUILD_VARIANTS ) ;
498
512
499
513
fs . writeFileSync ( `${ __dirname } /config.yml` , yaml . safeDump ( fileData , { lineWidth : 120 } ) , 'utf8' ) ;
0 commit comments