@@ -11,8 +11,12 @@ import groovy.transform.Field
11
11
12
12
/**
13
13
List of supported windows versions to be tested with
14
+ NOTE:
15
+ - 'windows-10' is too slow
16
+ - 'windows-2012-r2', 'windows-2008-r2', 'windows-7', 'windows-7-32-bit' are disabled
17
+ since we are working on releasing each windows version incrementally.
14
18
*/
15
- @Field def windowsVersions = [' windows-2019' , ' windows-2016' , ' windows-2012-r2 ' , ' windows-10 ' , ' windows-2008-r2 ' , ' windows-7 ' , ' windows-7-32-bit ' ]
19
+ @Field def windowsVersions = [' windows-2019' , ' windows-2016' ]
16
20
17
21
pipeline {
18
22
agent { label ' ubuntu && immutable' }
@@ -66,9 +70,7 @@ pipeline {
66
70
gitCheckout(basedir : " ${ BASE_DIR} " , githubNotifyFirstTimeContributor : true )
67
71
stashV2(name : ' source' , bucket : " ${ JOB_GCS_BUCKET} " , credentialsId : " ${ JOB_GCS_CREDENTIALS} " )
68
72
dir(" ${ BASE_DIR} " ){
69
- // NOTE: commented to run faster the windows pipeline.
70
- // when required then it can be enabled.
71
- // loadConfigEnvVars()
73
+ loadConfigEnvVars()
72
74
}
73
75
whenTrue(params. debug){
74
76
dumpFilteredEnvironment()
@@ -246,20 +248,21 @@ pipeline {
246
248
}
247
249
}
248
250
steps {
249
- mageTargetWin(" Winlogbeat Windows Unit test " , " x-pack/winlogbeat" , " build unitTest" )
251
+ mageTargetWin(" Winlogbeat x-pack Windows " , " x-pack/winlogbeat" , " build unitTest" )
250
252
}
251
253
}
252
254
stage(' Functionbeat' ){
253
255
options { skipDefaultCheckout() }
254
256
when {
255
257
beforeAgent true
256
258
expression {
257
- return env. BUILD_FUNCTIONBEAT_XPACK != " false"
259
+ return params. windowsTest
260
+ // NOTE: commented to run all the windows stages.
261
+ // return env.BUILD_FUNCTIONBEAT_XPACK != "false"
258
262
}
259
263
}
260
264
stages {
261
- stage(' Functionbeat Windows' ){
262
- agent { label ' windows-immutable && windows-2019' }
265
+ stage(' Functionbeat Windows x-pack' ){
263
266
options { skipDefaultCheckout() }
264
267
when {
265
268
beforeAgent true
@@ -268,7 +271,7 @@ pipeline {
268
271
}
269
272
}
270
273
steps {
271
- mageTargetWin(" Functionbeat Windows Unit test" , " x-pack/functionbeat" , " build unitTest" )
274
+ mageTargetWin(" Functionbeat x-pack Windows Unit test" , " x-pack/functionbeat" , " build unitTest" )
272
275
}
273
276
}
274
277
}
@@ -345,16 +348,22 @@ def mageTargetWin(String context, String directory, String target, String label)
345
348
return {
346
349
log(level : ' INFO' , text : " context=${ context} directory=${ directory} target=${ target} os=${ label} " )
347
350
def immutable = label. equals(' windows-7-32-bit' ) ? ' windows-immutable-32-bit' : ' windows-immutable'
348
- node(" ${ immutable} && ${ label} " ){
349
- withBeatsEnvWin() {
350
- whenTrue(params. debug) {
351
- dumpFilteredEnvironment()
352
- dumpMageWin()
353
- }
354
351
355
- def verboseFlag = params. debug ? " -v" : " "
356
- dir(directory) {
357
- bat(label : " Mage ${ target} " , script : " mage ${ verboseFlag} ${ target} " )
352
+ // NOTE: skip filebeat with windows-2016 since there are some test failures.
353
+ if (directory. equals(' filebeat' ) && label. equals(' windows-2016' )) {
354
+ log(level : ' WARN' , text : " Skipped stage for the 'filebeat' with 'windows-2016' as long as there are test failures to be analysed." )
355
+ } else {
356
+ node(" ${ immutable} && ${ label} " ){
357
+ withBeatsEnvWin() {
358
+ whenTrue(params. debug) {
359
+ dumpFilteredEnvironment()
360
+ dumpMageWin()
361
+ }
362
+
363
+ def verboseFlag = params. debug ? " -v" : " "
364
+ dir(directory) {
365
+ bat(label : " Mage ${ target} " , script : " mage ${ verboseFlag} ${ target} " )
366
+ }
358
367
}
359
368
}
360
369
}
@@ -407,13 +416,17 @@ def withBeatsEnv(boolean archive, Closure body) {
407
416
def withBeatsEnvWin (Closure body ) {
408
417
final String chocoPath = ' C:\\ ProgramData\\ chocolatey\\ bin'
409
418
final String chocoPython3Path = ' C:\\ Python38;C:\\ Python38\\ Scripts'
410
- def goRoot = " ${ env.USERPROFILE} \\ .gvm\\ versions\\ go${ GO_VERSION} .windows.amd64"
419
+ // NOTE: to support Windows 7 32 bits the arch in the go context path is required.
420
+ def arch = is32bit() ? ' 386' : ' amd64'
421
+ def goRoot = " ${ env.USERPROFILE} \\ .gvm\\ versions\\ go${ GO_VERSION} .windows.${ arch} "
411
422
412
423
withEnv([
413
424
" HOME=${ env.WORKSPACE} " ,
425
+ " DEV_ARCH=${ arch} " ,
426
+ " DEV_OS=windows" ,
414
427
" GOPATH=${ env.WORKSPACE} " ,
415
428
" GOROOT=${ goRoot} " ,
416
- " PATH=${ env.WORKSPACE} \\ bin;${ goRoot} \\ bin;${ chocoPath} ;${ chocoPython3Path} ;${ env.PATH} " ,
429
+ " PATH=${ env.WORKSPACE} \\ bin;${ goRoot} \\ bin;${ chocoPath} ;${ chocoPython3Path} ;C: \\ tools \\ mingw64 \\ bin; ${ env.PATH} " ,
417
430
" MAGEFILE_CACHE=${ env.WORKSPACE} \\ .magefile" ,
418
431
" TEST_COVERAGE=true" ,
419
432
" RACE_DETECTOR=true" ,
@@ -448,6 +461,11 @@ def installTools() {
448
461
}
449
462
}
450
463
464
+ def is32bit (){
465
+ def labels = env. NODE_LABELS
466
+ return labels. contains(' i386' )
467
+ }
468
+
451
469
def goos (){
452
470
def labels = env. NODE_LABELS
453
471
0 commit comments