forked from mongodb/mongo-tools-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.evergreen.yml
777 lines (712 loc) · 19 KB
/
.evergreen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
#######################################
# Tools Driver Config for MCI #
#######################################
# default command type
command_type: system
# run the same task in the previous revision if the current task fails
stepback: true
mongo_tools_variables:
## Common mongodb arguments
mongod_arguments:
default: &mongod_default_startup_args
mongod_args: ""
mongod_port: 33333
ssl: &mongod_ssl_startup_args
mongod_args: "--sslMode requireSSL --sslCAFile db/testdata/ca.pem --sslPEMKeyFile db/testdata/server.pem"
mongod_port: 33333
mongo_arguments:
default: &mongo_default_startup_args
mongo_args: &mongo_default_startup_args_string "--port 33333"
mongod_port: 33333
ssl: &mongo_ssl_startup_args
mongo_args: "--port 33333 --ssl --sslCAFile ./db/testdata/ca.pem --sslPEMKeyFile ./db/testdata/server.pem --sslAllowInvalidCertificates"
mongod_port: 33333
functions:
"attach-test-results":
- command: gotest.parse_files
type: system
params:
files:
- "src/github.com/mongodb/mongo-tools-common/testing_output/*.suite"
"fetch source" :
- command: shell.exec
params:
script: |
set -x
set -v
set -e
mkdir -p src/github.com/mongodb
- command: git.get_project
params:
directory: src/github.com/mongodb/mongo-tools-common
"download mongod":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools-common
script: |
set -x
set -v
set -e
mongotarget=$(if [ "${mongo_target}" ]; then echo "${mongo_target}"; else echo "${mongo_os}"; fi)
mongoversion=$(if [ "${mongo_version_always_use_latest}" ]; then echo "latest"; else echo "${mongo_version}"; fi)
dlurl=$(python binaryurl.py --edition=${mongo_edition} --target=$mongotarget --version=$mongoversion --arch=${mongo_arch|x86_64})
filename=$(echo $dlurl | sed -e "s_.*/__")
mkdir -p bin
curl -s $dlurl --output $filename
${decompress} $filename
rm $filename
if [ "${only_shell}" ]; then
mv -f ./mongodb-*/bin/mongo${extension} ./bin/
else
mv -f ./mongodb-*/bin/mongo${extension} ./bin/
mv -f ./mongodb-*/bin/mongos${extension} ./bin/
mv -f ./mongodb-*/bin/mongod${extension} ./bin/
fi
chmod +x ./bin/*
rm -rf ./mongodb-*
"start mongod":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools-common
background: true
script: |
set -x
set -v
set -e
rm -rf mongodb/db_files mongodb/${logfile|run.log}
mkdir -p mongodb/db_files
echo "Starting mongod..."
PATH=$PWD/bin:$PATH ./bin/mongod${extension} --port ${mongod_port} ${mongod_args} ${additional_args} --dbpath mongodb/db_files --setParameter=enableTestCommands=1
"wait for mongod to be ready":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools-common
script: |
set -x
set -v
SECS=0
while true ; do
set -o verbose
./bin/mongo${extension} ${mongo_args} --eval 'true;'
if [ "$?" = "0" ]; then
echo "mongod ready";
exit 0
else
SECS=`expr $SECS + 1`
if [ $SECS -gt 20 ]; then
echo "mongod not ready after 20 seconds"
exit 1
fi
echo "waiting for mongod ( ${mongo_args} ) to be ready..." ;
sleep 1 ;
fi
done
"setup kerberos integration test":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools-common
# Set up Kerberos stuff: run kinit if necessary, and add KDC to registry
# on Windows (see https://wiki.mongodb.com/display/DH/Testing+Kerberos)
script: |
set -e
# export sensitive info before `set -x`
if [ '${run_kinit}' = 'true' ]; then
# BUILD-3830
mkdir -p "$(pwd)/.evergreen"
touch "$(pwd)/.evergreen/krb5.conf.empty"
export KRB5_CONFIG="$(pwd)/.evergreen/krb5.conf.empty"
echo "Writing keytab"
echo ${kerberos_keytab} | base64 -d > "$(pwd)/.evergreen/drivers.keytab"
echo "Running kinit"
kinit -k -t "$(pwd)/.evergreen/drivers.keytab" -p drivers@LDAPTEST.10GEN.CC;
fi;
set -x
set -v
if [ "Windows_NT" = "$OS" ]; then
cmd /c "REG ADD HKLM\SYSTEM\ControlSet001\Control\Lsa\Kerberos\Domains\LDAPTEST.10GEN.CC /v KdcNames /d ldaptest.10gen.cc /t REG_MULTI_SZ /f"
fi;
"run tool unit tests":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools-common
script: |
set -x
set -v
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
fi;
. ./set_goenv.sh
GOROOT="" set_goenv || exit
if [ "${UNIT_TEST}" = "true" ]; then
export TOOLS_TESTING_UNIT="true"
fi;
if [ "${DB_TESTS}" = "true" ]; then
export TOOLS_TESTING_DB="true"
fi
if [ "${run_coverage}" = "true" ]; then
export RUN_COVERAGE="true"
fi
export ON_EVERGREEN="true"
./runTests.sh -v
exit $?
"run tool integration tests":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools-common
script: |
# export sensitive info before `set -x`
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
export MONGODB_KERBEROS_PASSWORD=${kerberos_password}
fi;
set -x
set -v
. ./set_goenv.sh
GOROOT="" set_goenv || exit
if [ "${INT_TEST}" = "true" ]; then
export TOOLS_TESTING_INTEGRATION="true"
fi;
if [ "${USE_SSL}" = "true" ]; then
export TOOLS_TESTING_SSL="true"
export TOOLS_TESTING_INTEGRATION="true"
fi;
if [ "${AUTH_TEST}" = "true" ]; then
export TOOLS_TESTING_AUTH="true"
export TOOLS_TESTING_INTEGRATION="true"
fi;
if [ "${KERBEROS_TEST}" = "true" ]; then
export TOOLS_TESTING_KERBEROS="true"
fi;
if [ "${create_mongod_users_command}" != "" ]; then
export TOOLS_TESTING_AUTH_USERNAME=${auth_username}
export TOOLS_TESTING_AUTH_PASSWORD=${auth_password}
echo "${create_mongod_users_command}" | ./bin/mongo${extension} ${mongo_args} admin
fi;
export ON_EVERGREEN="true"
./runTests.sh -v
exit $?
tasks:
- name: unit
commands:
- command: expansions.update
- func: "fetch source"
- func: "run tool unit tests"
vars:
UNIT_TEST: "true"
run_coverage: "true"
- func: "attach-test-results"
- name: integration-4.0
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod"
vars:
mongo_version: "4.0"
- func: "start mongod"
- func: "wait for mongod to be ready"
- func: "run tool integration tests"
vars:
INT_TEST: "true"
- func: "attach-test-results"
- name: integration-4.0-auth
commands:
- func: "fetch source"
# Concat auth args
- command: expansions.update
params:
updates:
- key: "mongod_args"
concat: " --auth"
- key: "auth_username"
value: "passwordIsTaco"
- key: "auth_password"
value: "Taco"
- key: "create_mongod_users_command"
value: "db.createUser({ user: '${auth_username}', pwd: '${auth_password}', roles: [{ role: '__system', db: 'admin' }] });"
- func: "download mongod"
vars:
mongo_version: "4.0"
- func: "start mongod"
- func: "wait for mongod to be ready"
- func: "run tool integration tests"
vars:
INT_TEST: "true"
AUTH_TEST: "true"
- func: "attach-test-results"
- name: kerberos
commands:
- func: "fetch source"
# Explicitly run ONLY Kerberos tests
- command: expansions.update
params:
updates:
- key: "args"
value: "${args} -test.types=kerberos"
- func: "setup kerberos integration test"
- func: "run tool integration tests"
vars:
KERBEROS_TEST: "true"
- func: "attach-test-results"
- name: lint
commands:
- func: "fetch source"
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools-common
script: |
set -x
set -v
set -e
. ./set_goenv.sh
GOROOT="" set_goenv || exit
go get -u golang.org/x/lint/golint
export PATH="$GOPATH/bin:$PATH"
./runLint.sh
- name: vet
commands:
- func: "fetch source"
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools-common
script: |
set -x
set -v
set -e
. ./set_goenv.sh
GOROOT="" set_goenv || exit
go vet -composites=false ./...
buildvariants:
#######################################
# Amazon x86_64 Buildvariants #
#######################################
- name: amazonlinux64
display_name: Amazon Linux 64
run_on:
- linux-64-amzn-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: amazonlinux64-enterprise
display_name: Amazon Linux 64 Enterprise
run_on:
- linux-64-amzn-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
- name: amazon2
display_name: Amazon Linux 64 v2
run_on:
- amazon2-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: amazon2-enterprise
display_name: Amazon Linux 64 v2 Enterprise
run_on:
- amazon2-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
#######################################
# Debian x86_64 Buildvariants #
#######################################
- name: debian81
display_name: Debian 8.1
run_on:
- debian81-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: debian81-enterprise
display_name: Debian 8.1 Enterprise
run_on:
- debian81-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
- name: debian92
display_name: Debian 9.2
run_on:
- debian92-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: debian92-enterprise
display_name: Debian 9.2 Enterprise
run_on:
- debian92-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
#######################################
# macOS Buildvariant #
#######################################
- name: macOS-1012
display_name: MacOS 10.12
run_on:
- macos-1012
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "osx"
mongo_target: "osx-ssl"
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: macOS-1012-ssl
display_name: MacOS 10.12 SSL
run_on:
- macos-1012
expansions:
<<: *mongod_ssl_startup_args
<<: *mongo_ssl_startup_args
mongo_os: "osx"
mongo_target: "osx-ssl"
build_tags: "ssl"
excludes: requires_many_files
USE_SSL: "true"
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
#######################################
# RHEL x86_64 Buildvariants #
#######################################
- name: rhel62
display_name: RHEL 6.2
run_on:
- rhel62-test
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "rhel62"
mongo_edition: "targeted"
build_tags: ""
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: rhel62-ssl
display_name: RHEL 6.2 SSL
run_on:
- rhel62-test
expansions:
<<: *mongod_ssl_startup_args
<<: *mongo_ssl_startup_args
mongo_os: "rhel62"
mongo_edition: "enterprise"
build_tags: "ssl"
edition: ssl
smoke_use_ssl: --use-ssl
USE_SSL: "true"
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: rhel62-enterprise
display_name: RHEL 6.2 Enterprise
run_on:
- rhel62-test
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "rhel62"
mongo_edition: "enterprise"
build_tags: "ssl sasl"
edition: enterprise
run_kinit: true
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: kerberos
- name: vet
- name: lint
- name: rhel70
display_name: RHEL 7.0
run_on:
- rhel70
expansions:
build_tags: ""
tasks:
- name: unit
- name: rhel70-enterprise
display_name: RHEL 7.0 Enterprise
run_on:
- rhel70
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
#######################################
# SUSE x86_64 Buildvariants #
#######################################
- name: suse12
display_name: SUSE 12
run_on:
- suse12-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: suse12-enterprise
display_name: SUSE 12 Enterprise
run_on:
- suse12-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
#######################################
# Ubuntu x86_64 Buildvariants #
#######################################
- name: ubuntu1404
display_name: Ubuntu 14.04
run_on:
- ubuntu1404-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: ubuntu1404-enterprise
display_name: Ubuntu 14.04 Enterprise
run_on:
- ubuntu1404-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
- name: ubuntu1604
display_name: Ubuntu 16.04
run_on:
- ubuntu1604-test
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "ubuntu1604"
mongo_edition: "targeted"
build_tags: ""
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: ubuntu1604-ssl
display_name: Ubuntu 16.04 SSL
run_on:
- ubuntu1604-test
expansions:
<<: *mongod_ssl_startup_args
<<: *mongo_ssl_startup_args
mongo_os: "ubuntu1604"
mongo_edition: "enterprise"
build_tags: "ssl"
edition: ssl
USE_SSL: "true"
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: ubuntu1604-enterprise
display_name: Ubuntu 16.04 Enterprise
run_on:
- ubuntu1604-test
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "ubuntu1604"
mongo_edition: "enterprise"
build_tags: "ssl sasl"
edition: enterprise
run_kinit: true
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: kerberos
- name: ubuntu1804
display_name: Ubuntu 18.04
run_on:
- ubuntu1804-test
expansions:
build_tags: ""
tasks:
- name: unit
- name: ubuntu1804-enterprise
display_name: Ubuntu 18.04 Enterprise
run_on:
- ubuntu1804-test
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
#######################################
# Windows Buildvariants #
#######################################
- name: windows-64
display_name: Windows 64-bit
run_on:
- windows-64-vs2013-test
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "windows-64"
mongo_target: "windows_x86_64-2008plus-ssl"
extension: .exe
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: windows-64-ssl
display_name: Windows 64-bit SSL
run_on:
- windows-64-vs2013-compile
expansions:
<<: *mongod_ssl_startup_args
<<: *mongo_ssl_startup_args
mongo_os: "windows-64"
mongo_target: "windows_x86_64-2008plus-ssl"
build_tags: "ssl"
edition: ssl
extension: .exe
USE_SSL: "true"
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: windows-64-enterprise
display_name: Windows 64-bit Enterprise
run_on:
- windows-64-vs2013-compile
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "windows-64"
mongo_edition: "enterprise"
mongo_target: "windows"
build_tags: "sasl ssl"
edition: enterprise
extension: .exe
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: kerberos
#######################################
# ARM Buildvariants #
#######################################
- name: ubuntu1604-arm64-ssl
display_name: ZAP ARM64 Ubuntu 16.04 SSL
run_on:
- ubuntu1604-arm64-small
stepback: false
batchtime: 10080 # weekly
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "ubuntu1604"
mongo_edition: "targeted"
mongo_arch: "arm64"
build_tags: "ssl"
edition: ssl
USE_SSL: "true"
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
#######################################
# Power Buildvariants #
#######################################
- name: rhel71-ppc64le-enterprise
display_name: ZAP PPC64LE RHEL 7.1 Enterprise
run_on:
- rhel71-power8-test
stepback: false
batchtime: 10080 # weekly
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "rhel71"
mongo_edition: "enterprise"
mongo_arch: "ppc64le"
build_tags: 'ssl sasl'
edition: enterprise
run_kinit: true
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: ubuntu1604-ppc64le-enterprise
display_name: ZAP PPC64LE Ubuntu 16.04 Enterprise
run_on:
- ubuntu1604-power8-test
stepback: false
batchtime: 10080 # weekly
expansions:
build_tags: 'ssl sasl'
tasks:
- name: unit
#######################################
# Z (s390x) Buildvariants #
#######################################
- name: rhel67-s390x-enterprise
display_name: ZAP s390x RHEL 6.7 Enterprise
run_on:
- rhel67-zseries-test
stepback: false
batchtime: 10080 # weekly
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "rhel67"
mongo_edition: "enterprise"
mongo_arch: "s390x"
build_tags: "sasl ssl"
edition: enterprise
run_kinit: true
tasks:
- name: unit
- name: integration-4.0
- name: integration-4.0-auth
- name: kerberos
- name: ubuntu1604-s390x-enterprise
display_name: ZAP s390x Ubuntu 16.04 Enterprise
run_on:
- ubuntu1604-zseries-small
stepback: false
batchtime: 10080 # weekly
expansions:
build_tags: "sasl ssl"
tasks:
- name: unit
#######################################
# Experimental Buildvariants #
#######################################
- name: ubuntu-race
stepback: false
batchtime: 1440 # daily
display_name: z Race Detector Ubuntu 16.04
run_on:
- ubuntu1604-test
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "ubuntu1604"
mongo_edition: "enterprise"
build_tags: "sasl ssl"
args: "-race"
tasks:
- name: unit
- name: integration-4.0