@@ -74,10 +74,7 @@ const OPERATING_SYSTEMS = [
74
74
)
75
75
) ;
76
76
77
- const WINDOWS_SKIP_TAGS = new Set ( [
78
- 'atlas-connect' ,
79
- 'auth'
80
- ] ) ;
77
+ const WINDOWS_SKIP_TAGS = new Set ( [ 'atlas-connect' , 'auth' ] ) ;
81
78
82
79
const BASE_TASKS = [ ] ;
83
80
const TASKS = [ ] ;
@@ -109,9 +106,7 @@ function makeTask({ mongoVersion, topology }) {
109
106
}
110
107
111
108
MONGODB_VERSIONS . forEach ( mongoVersion => {
112
- TOPOLOGIES . forEach ( topology =>
113
- BASE_TASKS . push ( makeTask ( { mongoVersion, topology } ) )
114
- ) ;
109
+ TOPOLOGIES . forEach ( topology => BASE_TASKS . push ( makeTask ( { mongoVersion, topology } ) ) ) ;
115
110
} ) ;
116
111
117
112
TASKS . push (
@@ -125,7 +120,8 @@ TASKS.push(
125
120
tags : [ 'auth' , 'kerberos' , 'legacy' ] ,
126
121
commands : [
127
122
{ func : 'install dependencies' } ,
128
- { func : 'run kerberos tests' ,
123
+ {
124
+ func : 'run kerberos tests' ,
129
125
vars : {
130
126
UNIFIED : 0
131
127
}
@@ -137,7 +133,8 @@ TASKS.push(
137
133
tags : [ 'auth' , 'kerberos' , 'unified' ] ,
138
134
commands : [
139
135
{ func : 'install dependencies' } ,
140
- { func : 'run kerberos tests' ,
136
+ {
137
+ func : 'run kerberos tests' ,
141
138
vars : {
142
139
UNIFIED : 1
143
140
}
@@ -296,7 +293,7 @@ OCSP_VERSIONS.forEach(VERSION => {
296
293
const AWS_AUTH_TASKS = [ ] ;
297
294
298
295
AWS_AUTH_VERSIONS . forEach ( VERSION => {
299
- const name = ( ex ) => `aws-${ VERSION } -auth-test-${ ex . split ( ' ' ) . join ( '-' ) } ` ;
296
+ const name = ex => `aws-${ VERSION } -auth-test-${ ex . split ( ' ' ) . join ( '-' ) } ` ;
300
297
// AWS_AUTH_TASKS.push(name);
301
298
302
299
const aws_funcs = [
@@ -325,10 +322,10 @@ AWS_AUTH_VERSIONS.forEach(VERSION => {
325
322
{ func : 'setup aws env' } ,
326
323
fn
327
324
]
328
- } ) )
325
+ } ) ) ;
329
326
330
327
TASKS . push ( ...aws_tasks ) ;
331
- AWS_AUTH_TASKS . push ( ...aws_tasks . map ( t => t . name ) )
328
+ AWS_AUTH_TASKS . push ( ...aws_tasks . map ( t => t . name ) ) ;
332
329
} ) ;
333
330
334
331
const BUILD_VARIANTS = [ ] ;
@@ -342,31 +339,33 @@ const getTaskList = (() => {
342
339
return memo [ key ] ;
343
340
}
344
341
const taskList = BASE_TASKS . concat ( TASKS ) ;
345
- const ret = taskList . filter ( task => {
346
- if ( task . name . match ( / ^ a w s / ) ) return false ;
342
+ const ret = taskList
343
+ . filter ( task => {
344
+ if ( task . name . match ( / ^ a w s / ) ) return false ;
347
345
348
- // skip unsupported tasks on windows
349
- if ( os . match ( / ^ w i n d o w s / ) && task . tags . filter ( tag => WINDOWS_SKIP_TAGS . has ( tag ) ) . length ) {
350
- return false ;
351
- }
346
+ // skip unsupported tasks on windows
347
+ if ( os . match ( / ^ w i n d o w s / ) && task . tags . filter ( tag => WINDOWS_SKIP_TAGS . has ( tag ) ) . length ) {
348
+ return false ;
349
+ }
352
350
353
- const tasksWithVars = task . commands . filter ( task => ! ! task . vars ) ;
354
- if ( ! tasksWithVars . length ) {
355
- return true ;
356
- }
351
+ const tasksWithVars = task . commands . filter ( task => ! ! task . vars ) ;
352
+ if ( ! tasksWithVars . length ) {
353
+ return true ;
354
+ }
357
355
358
- // kerberos tests don't require mongo orchestration
359
- if ( task . tags . filter ( tag => tag === 'kerberos' ) . length ) {
360
- return true ;
361
- }
356
+ // kerberos tests don't require mongo orchestration
357
+ if ( task . tags . filter ( tag => tag === 'kerberos' ) . length ) {
358
+ return true ;
359
+ }
362
360
363
- const { VERSION } = tasksWithVars [ 0 ] . vars || { } ;
364
- if ( VERSION === 'latest' ) {
365
- return semver . satisfies ( semver . coerce ( LATEST_EFFECTIVE_VERSION ) , mongoVersion ) ;
366
- }
361
+ const { VERSION } = tasksWithVars [ 0 ] . vars || { } ;
362
+ if ( VERSION === 'latest' ) {
363
+ return semver . satisfies ( semver . coerce ( LATEST_EFFECTIVE_VERSION ) , mongoVersion ) ;
364
+ }
367
365
368
- return semver . satisfies ( semver . coerce ( VERSION ) , mongoVersion ) ;
369
- } ) . map ( x => x . name ) ;
366
+ return semver . satisfies ( semver . coerce ( VERSION ) , mongoVersion ) ;
367
+ } )
368
+ . map ( x => x . name ) ;
370
369
371
370
memo [ key ] = ret ;
372
371
return ret ;
@@ -419,38 +418,48 @@ SINGLETON_TASKS.push({
419
418
]
420
419
} ) ;
421
420
422
- SINGLETON_TASKS . push ( {
423
- name : 'run-custom-csfle-tests' ,
424
- tags : [ 'run-custom-csfle-tests' ] ,
421
+ const oneOffFuncs = [
422
+ { func : 'run custom csfle tests' , vars : { UNIFIED : 1 , NODE_LTS_NAME : 'erbium' } } ,
423
+ { func : 'run custom snappy tests' , vars : { UNIFIED : 1 , NODE_LTS_NAME : 'erbium' } }
424
+ ] ;
425
+
426
+ const oneOffFuncAsTasks = oneOffFuncs . map ( oneOffFunc => ( {
427
+ name : `${ oneOffFunc . func . split ( ' ' ) . join ( '-' ) } ` ,
428
+ tags : [ 'run-custom-dependency-tests' ] ,
425
429
commands : [
426
430
{
427
431
func : 'install dependencies' ,
428
432
vars : {
429
- NODE_LTS_NAME : 'erbium' ,
430
- } ,
433
+ NODE_LTS_NAME : 'erbium'
434
+ }
431
435
} ,
432
436
{
433
437
func : 'bootstrap mongo-orchestration' ,
434
438
vars : {
435
- VERSION : '4.4 ' ,
439
+ VERSION : '5.0 ' ,
436
440
TOPOLOGY : 'server'
437
441
}
438
442
} ,
439
- { func : 'run custom csfle tests' }
443
+ oneOffFunc
440
444
]
441
- } ) ;
445
+ } ) ) ;
442
446
443
- BUILD_VARIANTS . push ( {
444
- name : 'lint' ,
445
- display_name : 'lint' ,
446
- run_on : 'rhel70' ,
447
- tasks : [ 'run-checks' ]
448
- } , {
449
- name : 'ubuntu1804-custom-csfle-tests' ,
450
- display_name : 'Custom FLE Version Test' ,
451
- run_on : 'ubuntu1804-test' ,
452
- tasks : [ 'run-custom-csfle-tests' ]
453
- } ) ;
447
+ SINGLETON_TASKS . push ( ...oneOffFuncAsTasks ) ;
448
+
449
+ BUILD_VARIANTS . push (
450
+ {
451
+ name : 'lint' ,
452
+ display_name : 'lint' ,
453
+ run_on : 'rhel70' ,
454
+ tasks : [ 'run-checks' ]
455
+ } ,
456
+ {
457
+ name : 'ubuntu1804-custom-dependency-tests' ,
458
+ display_name : 'Custom Dependency Version Test' ,
459
+ run_on : 'ubuntu1804-large' ,
460
+ tasks : oneOffFuncAsTasks . map ( ( { name } ) => name )
461
+ }
462
+ ) ;
454
463
455
464
// special case for MONGODB-AWS authentication
456
465
BUILD_VARIANTS . push ( {
@@ -464,7 +473,7 @@ BUILD_VARIANTS.push({
464
473
} ) ;
465
474
466
475
const fileData = yaml . safeLoad ( fs . readFileSync ( `${ __dirname } /config.yml.in` , 'utf8' ) ) ;
467
- fileData . tasks = ( fileData . tasks || [ ] ) . concat ( BASE_TASKS ) . concat ( TASKS ) . concat ( SINGLETON_TASKS ) ;
476
+ fileData . tasks = ( fileData . tasks || [ ] ) . concat ( BASE_TASKS , TASKS , SINGLETON_TASKS ) ;
468
477
fileData . buildvariants = ( fileData . buildvariants || [ ] ) . concat ( BUILD_VARIANTS ) ;
469
478
470
479
fs . writeFileSync ( `${ __dirname } /config.yml` , yaml . safeDump ( fileData , { lineWidth : 120 } ) , 'utf8' ) ;
0 commit comments