@@ -6,7 +6,7 @@ const yaml = require('js-yaml');
6
6
7
7
const LATEST_EFFECTIVE_VERSION = '5.0' ;
8
8
const MONGODB_VERSIONS = [ 'latest' , '4.2' , '4.0' , '3.6' , '3.4' , '3.2' , '3.0' , '2.6' ] ;
9
- const NODE_VERSIONS = [ 'dubnium' , 'carbon' , 'boron' , 'argon' ] ;
9
+ const NODE_VERSIONS = [ 'erbium' , ' dubnium', 'carbon' , 'boron' , 'argon' ] ;
10
10
const TOPOLOGIES = [ 'server' , 'replica_set' , 'sharded_cluster' ] . concat ( [
11
11
'server-unified' ,
12
12
'replica_set-unified' ,
@@ -37,7 +37,7 @@ const OPERATING_SYSTEMS = [
37
37
run_on : 'ubuntu1804-test' ,
38
38
mongoVersion : '>=3.2' ,
39
39
clientEncryption : true
40
- } ,
40
+ }
41
41
42
42
// Windows. reenable this when nvm supports windows, or we settle on an alternative tool
43
43
// {
@@ -67,6 +67,7 @@ const OPERATING_SYSTEMS = [
67
67
) ;
68
68
69
69
const TASKS = [ ] ;
70
+ const SINGLETON_TASKS = [ ] ;
70
71
71
72
function makeTask ( { mongoVersion, topology } ) {
72
73
let topologyForTest = topology ;
@@ -80,9 +81,7 @@ function makeTask({ mongoVersion, topology }) {
80
81
name : `test-${ mongoVersion } -${ topology } ` ,
81
82
tags : [ mongoVersion , topology ] ,
82
83
commands : [
83
- {
84
- func : 'install dependencies'
85
- } ,
84
+ { func : 'install dependencies' } ,
86
85
{
87
86
func : 'bootstrap mongo-orchestration' ,
88
87
vars : {
@@ -101,20 +100,11 @@ MONGODB_VERSIONS.forEach(mongoVersion => {
101
100
} ) ;
102
101
} ) ;
103
102
103
+ // singleton task for connectivity tests
104
104
TASKS . push ( {
105
105
name : 'test-atlas-connectivity' ,
106
106
tags : [ 'atlas-connect' ] ,
107
- commands : [
108
- {
109
- func : 'install dependencies'
110
- } ,
111
- {
112
- func : 'run atlas tests' ,
113
- vars : {
114
- VERSION : 'latest'
115
- }
116
- }
117
- ]
107
+ commands : [ { func : 'install dependencies' } , { func : 'run atlas tests' } ]
118
108
} ) ;
119
109
120
110
const BUILD_VARIANTS = [ ] ;
@@ -129,8 +119,12 @@ const getTaskList = (() => {
129
119
}
130
120
131
121
const ret = TASKS . filter ( task => {
132
- const { VERSION } = task . commands . filter ( task => ! ! task . vars ) [ 0 ] . vars ;
122
+ const tasksWithVars = task . commands . filter ( task => ! ! task . vars ) ;
123
+ if ( ! tasksWithVars . length ) {
124
+ return true ;
125
+ }
133
126
127
+ const { VERSION } = tasksWithVars [ 0 ] . vars || { } ;
134
128
if ( VERSION === 'latest' ) {
135
129
return semver . satisfies ( semver . coerce ( LATEST_EFFECTIVE_VERSION ) , mongoVersion ) ;
136
130
}
@@ -170,9 +164,30 @@ OPERATING_SYSTEMS.forEach(
170
164
}
171
165
) ;
172
166
173
- const fileData = yaml . safeLoad ( fs . readFileSync ( `${ __dirname } /config.yml.in` , 'utf8' ) ) ;
167
+ // singleton build variant for linting
168
+ SINGLETON_TASKS . push ( {
169
+ name : 'run-checks' ,
170
+ tags : [ 'run-checks' ] ,
171
+ commands : [
172
+ {
173
+ func : 'install dependencies' ,
174
+ vars : {
175
+ NODE_LTS_NAME : 'erbium'
176
+ }
177
+ } ,
178
+ { func : 'run checks' }
179
+ ]
180
+ } ) ;
174
181
175
- fileData . tasks = ( fileData . tasks || [ ] ) . concat ( TASKS ) ;
182
+ BUILD_VARIANTS . push ( {
183
+ name : 'lint' ,
184
+ display_name : 'lint' ,
185
+ run_on : 'rhel70' ,
186
+ tasks : [ 'run-checks' ]
187
+ } ) ;
188
+
189
+ const fileData = yaml . safeLoad ( fs . readFileSync ( `${ __dirname } /config.yml.in` , 'utf8' ) ) ;
190
+ fileData . tasks = ( fileData . tasks || [ ] ) . concat ( TASKS ) . concat ( SINGLETON_TASKS ) ;
176
191
fileData . buildvariants = ( fileData . buildvariants || [ ] ) . concat ( BUILD_VARIANTS ) ;
177
192
178
193
fs . writeFileSync ( `${ __dirname } /config.yml` , yaml . safeDump ( fileData , { lineWidth : 120 } ) , 'utf8' ) ;
0 commit comments