forked from mongodb/mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevergreen.yml
6204 lines (5882 loc) · 184 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
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#####################################################
# A note on expansions #
#####################################################
# Expansions usually appear in the form ${key|default}
# If 'key' is found in the executor's map of currently known
# expansions, the corresponding value is used. If the key can
# not be found, the default is used.
#
# Arbitrary expansions can be specified in the YAML cofiguration
# files in the following places:
# - The 'expansions' field for buildvariants (branch file)
# - The 'expansions' field for distros (distros file)
#
# A number of 'built-in' expansions are also available for use; these include:
# - environment variables available on the host machine
# - 'workdir' (references the executor's work directory).
# - 'task_id' (references the task id of the task the executor is working on).
# - 'build_variant' (references the executing task's buildvariant).
# - 'config_root' (references the root directory for the executor's configuration artifacts).
stepback: true
command_type: system
## Some variables for convenience:
variables:
# Used for tests that invoke resmoke.py and require no additional setup.
- &task_template
name: template
depends_on:
- name: compile
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --help
run_multiple_jobs: false
max_jobs: 0 # If set in combination with run_multiple_jobs, will cap the number of jobs used.
- &run_jstestfuzz_tests
func: "run tests"
# Terminate the function when there has been no output to stdout for 30 minutes. E.g. when something is stuck in an infinite loop.
# resmoke.py writes the test output to logkeeper and only writes to stdout when starting the next test.
# resmoke.py not producing output on stdout means that the test is still running and presumably not going to finish.
# Note that timeout_secs is different from exec_timeout_secs, which applies to a task and times out regardless of whether output has been written to stdout.
timeout_secs: 1800
vars:
resmoke_args: --help # resmoke_args needs to be overridden to specify one of the jstestfuzz suites
should_shuffle: false
continue_on_failure: false
# Used for tests that invoke 'resmoke.py --suites=jstestfuzz*'.
- &jstestfuzz_template
name: jstestfuzz_template
exec_timeout_secs: 7200 # Time out the task if it runs for more than 2 hours.
depends_on:
- name: compile
commands:
- func: "do setup"
- func: "run jstestfuzz"
- *run_jstestfuzz_tests
- &debug_symbol_variants
- enterprise-linux-64-amazon-ami
- enterprise-osx-107
- enterprise-rhel-57-64-bit
- enterprise-rhel-62-64-bit
- enterprise-rhel-70-64-bit
- enterprise-rhel-71-ppc64le
- enterprise-suse11-64
- enterprise-suse12-64
- enterprise-ubuntu1204-64
- enterprise-ubuntu1404-64
- enterprise-ubuntu1604-64
- enterprise-debian71-64
- enterprise-debian81-64
- linux-32
- linux-64
- amazon
- rhel55
- rhel62
- rhel70
- suse11
- suse12
- ubuntu1204
- ubuntu1404
- ubuntu1604
- ubuntu1404-rocksdb
- debian71
- debian81
- solaris-64-bit
- osx-107-ssl
- osx-107
#######################################
# Functions #
#######################################
functions:
"fetch artifacts" : &fetch_artifacts
command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/artifacts/${build_id}.tgz
bucket: mciuploads
extract_to: src
"fetch binaries" : &fetch_binaries
command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/binaries/mongo-${build_id}.${ext|tgz}
bucket: mciuploads
local_file: src/mongo-binaries.tgz
"extract binaries" : &extract_binaries
command: shell.exec
params:
working_dir: src
script: |
${decompress|unzip} mongo-binaries.tgz
"check binary version" : &check_binary_version
command: shell.exec
params:
working_dir: src
script: |
set -o errexit
mongo_binary=$(find mongodb*/bin -name mongo${exe})
# There should only be one mongo shell
if [ $(echo $mongo_binary | wc -w) -ne 1 ]; then
echo "There is more than 1 extracted mongo binary: $mongo_binary"
exit 1
fi
bin_ver=$(${python|python} -c "import yaml; print(yaml.safe_load(open('compile_expansions.yml'))['version']);" | tr -d '[ \r\n]')
# Due to SERVER-23810, we cannot use $mongo_binary --quiet --nodb --eval "version();"
mongo_ver=$($mongo_binary --version | cut -f2 -d ':' | tr -d '[ \r\n]')
# The versions must match
if [ "$bin_ver" != "$mongo_ver" ]; then
echo "The mongo version is $mongo_ver, expected version is $bin_ver"
exit 1
fi
"get buildnumber" : &get_buildnumber
command: keyval.inc
params:
key: "${build_variant}_v3.2"
destination: "builder_num"
"setup credentials" : &setup_credentials
command: shell.exec
params:
working_dir: src
silent: true
script: |
cat > mci.buildlogger <<END_OF_CREDS
slavename='${slave}'
passwd='${passwd}'
builder='MCI_${build_variant}'
build_num=${builder_num}
build_phase='${task_name}_${execution}'
END_OF_CREDS
"upload debugsymbols" :
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/mongo-debugsymbols.tgz
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/debugsymbols/debugsymbols-${build_id}.${ext|tgz}
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
build_variants:
*debug_symbol_variants
"fetch debugsymbols archive" :
command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/debugsymbols/debugsymbols-${build_id}.${ext|tgz}
bucket: mciuploads
local_file: src/mongo-debugsymbols.tgz
build_variants:
*debug_symbol_variants
"build rocksdb" :
command: shell.exec
params:
script: |
set -o errexit
set -o verbose
if [ "${build_rocksdb|}" = "true" ]; then
rm -rf rocksdb
git clone https://github.com/facebook/rocksdb.git
cd rocksdb
make static_lib
fi
"build new tools" :
command: shell.exec
params:
working_dir: src/mongo-tools
script: |
set -o verbose
set -o errexit
# make sure newlines in the scripts are handled correctly by windows
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
fi;
. ./${set_tools_gopath|set_gopath.sh}
sed -i.bak "s/built-without-version-string/$(git describe)/" common/options/options.go
sed -i.bak "s/built-without-git-spec/$(git rev-parse HEAD)/" common/options/options.go
for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongooplog; do
${gorootvars} go build ${tooltags|} -o "../src/mongo-tools/$i${exe|}" $i/main/$i.go
"../src/mongo-tools/$i${exe|}" --version
done
"do setup" :
- *fetch_artifacts
- *fetch_binaries
- *extract_binaries
- *check_binary_version
- *get_buildnumber
- *setup_credentials
"set up virtualenv" :
command: shell.exec
type: test
params:
working_dir: src
script: |
# exit immediately if virtualenv is not found
set -o errexit
set -o verbose
if [ ${build_variant} == enterprise-suse12-64 ]; then
virtualenv ./venv
else
virtualenv --system-site-packages ./venv
fi
"run tests" :
command: shell.exec
type: test
params:
working_dir: src
script: |
set -o errexit
set -o verbose
# check if virtualenv is set up
if [ -d "venv" ]; then
if [ "Windows_NT" = "$OS" ]; then
. ./venv/Scripts/activate
else
. ./venv/bin/activate
fi
fi
cp mongodb*/bin/* .
extra_args=""
if [ ${run_multiple_jobs|false} = true ]; then
if [ ${max_jobs|0} -gt 0 ] && [ ${max_jobs|0} -lt ${num_jobs_available|1} ]; then
extra_args="$extra_args --jobs=${max_jobs}"
else
extra_args="$extra_args --jobs=${num_jobs_available|1}"
fi
fi
if [ ${should_shuffle|true} = true ]; then
extra_args="$extra_args --shuffle"
fi
if [ ${continue_on_failure|true} = true ]; then
extra_args="$extra_args --continueOnFailure"
fi
# Default storageEngineCacheSizeGB to 1. Override on individual test config if needed.
# resmoke will assign to the appropriate parameter on storage engines that support it.
set +o errexit
echo "${resmoke_args}" | grep -q storageEngineCacheSizeGB
if [ $? -eq 1 ]; then
extra_args="$extra_args --storageEngineCacheSizeGB=1"
fi
set -o errexit
${path_prefix} ${asan_symbolizer} ${enable_lsan} ${rlp_environment} ${python|python} buildscripts/resmoke.py ${resmoke_args} $extra_args ${test_flags} --log=buildlogger --reportFile=report.json
"run jstestfuzz":
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
set -o verbose
git clone [email protected]:10gen/jstestfuzz.git
cp mongodb*/bin/mongod .
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
set -o verbose
git clone --depth 1 [email protected]:10gen/mongo-enterprise-modules.git jstests/enterprise_tests
git clone --depth 1 [email protected]:10gen/QA.git jstests/qa_tests
- command: shell.exec
type: test
params:
working_dir: src/jstestfuzz
script: |
set -o errexit
set -o verbose
if [ "Windows_NT" = "$OS" ]; then
# An "npm" directory might not have been created in %APPDATA% by the Windows installer.
# Work around the issue by specifying a different %APPDATA% path.
# See: https://github.com/nodejs/node-v0.x-archive/issues/8141
export APPDATA=${workdir}/npm-app-data
export PATH="$PATH:/cygdrive/c/Program Files (x86)/nodejs"
else
export PATH="$PATH:/opt/node/bin"
fi
npm start -- --jsTestsDir ../jstests
- command: archive.targz_pack
params:
target: "jstests.tgz"
source_dir: "src/jstestfuzz"
include:
- "out/*.js"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: jstests.tgz
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/jstestfuzz/${task_id}-${execution}.tgz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: Generated Tests - Execution ${execution}
"do multiversion setup" :
command: shell.exec
params:
working_dir: src
script: |
set -o errexit
set -o verbose
rm -rf /data/install /data/multiversion
${python|python} buildscripts/setup_multiversion_mongodb.py /data/install /data/multiversion "base" ${multiversion_platform_arch|"Linux/x86_64"} "2.4" "2.6" "3.0" "3.2.1"
"download mongod for validation checking" :
command: shell.exec
params:
working_dir: src
script: |
set -o errexit
set -o verbose
rm -rf /data/install /data/multiversion
${python|python} buildscripts/setup_multiversion_mongodb.py /data/install /data/multiversion "base" ${multiversion_platform_arch|"Linux/x86_64"} "3.3.10"
"cleanup environment" :
command: shell.exec
params:
script: |
set -o errexit
set -o verbose
rm -rf src /data/db/* mongo-coredumps.tgz ~/.aws
"set up kitchen credentials":
command: shell.exec
params:
silent: true
script: |
set -o errexit
mkdir -p ~/.ssh ~/.aws
echo -n "${kitchen_private_key}" > ~/.ssh/kitchen.pem
chmod 0600 ~/.ssh/kitchen.pem
cat <<EOF > ~/.aws/config
[default]
region = us-east-1
EOF
cat <<EOF > ~/.aws/credentials
[default]
aws_access_key_id = ${kitchen_aws_key}
aws_secret_access_key = ${kitchen_aws_secret}
EOF
"run kitchen":
command: shell.exec
type: test
params:
shell: bash
working_dir: src/buildscripts/package_test
script: |
set -o errexit
export KITCHEN_ARTIFACTS_URL="https://s3.amazonaws.com/mciuploads/${project}/${build_variant}/${revision}/artifacts/${build_id}.tgz"
export KITCHEN_SECURITY_GROUP="${kitchen_security_group}"
export KITCHEN_SSH_KEY_ID="${kitchen_ssh_key_id}"
export KITCHEN_SUBNET="${kitchen_subnet}"
for i in {1..3}
do
if ! kitchen verify "${packager_distro}"; then
verified="false"
kitchen destroy "${packager_distro}" || true
sleep 30
else
verified="true"
break
fi
done
kitchen destroy "${packager_distro}" || true
test "$verified" = "true"
pre:
- command: shell.track
- command: shell.exec
params:
script: |
${killall_mci|pkill -9 mongod; pkill -9 mongos; pkill -9 mongo; pkill -9 bsondump; pkill -9 mongoimport; pkill -9 mongoexport; pkill -9 mongodump; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongofiles; pkill -9 mongooplog; pkill -9 mongotop; pkill -9 mongobridge; pkill -9 mongod-2.6; pkill -9 mongos-2.6; pkill -9 mongo-2.6; pkill -9 bsondump-2.6; pkill -9 mongoimport-2.6; pkill -9 mongoexport-2.6; pkill -9 mongodump-2.6; pkill -9 mongorestore-2.6; pkill -9 mongostat-2.6; pkill -9 mongofiles-2.6; pkill -9 mongooplog-2.6; pkill -9 mongotop-2.6; pkill -9 mongobridge-2.6; pkill -9 mongod-2.4; pkill -9 mongos-2.4; pkill -9 mongo-2.4; pkill -9 bsondump-2.4; pkill -9 mongoimport-2.4; pkill -9 mongoexport-2.4; pkill -9 mongodump-2.4; pkill -9 mongorestore-2.4; pkill -9 mongostat-2.4; pkill -9 mongofiles-2.4; pkill -9 mongooplog-2.4; pkill -9 mongotop-2.4; pkill -9 resmoke.py; pkill -9 python; pkill -9 cl; pkill -9 lldb; pkill -9 _test} >/dev/null 2>&1
# Set errexit after running the pkill commands because pkill will exit with code 1 if it
# does not match any processes. This can occur when there are no left-over processes from
# a previous task.
set -o errexit
set -o verbose
- func: "cleanup environment"
- command: expansions.update
params:
updates:
- key: set_sudo
value: |
set -o | grep errexit | grep on
errexit_on=$?
# Set errexit "off".
set +o errexit
sudo=
# Use sudo, if it is supported.
sudo date > /dev/null 2>&1
if [ $? -eq 0 ]; then
sudo=sudo
fi
# Set errexit "on", if previously enabled.
if [ $errexit_on -eq 0 ]; then
set -o errexit
fi
- command: shell.exec
params:
system_log: true
script: |
set -o errexit
set -o verbose
ulimit -a
# Clear the dmesg ring buffer. The "post" phase will check dmesg for OOM messages.
${set_sudo}
$sudo dmesg --clear > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Cleared the dmesg ring buffer"
else
echo "Could not clear the dmesg ring buffer"
fi
post:
- command: attach.results
params:
file_location: src/report.json
- command: shell.exec
params:
silent: true
script: |
${killall_mci|pkill -9 mongod; pkill -9 mongos; pkill -9 mongo; pkill -9 bsondump; pkill -9 mongoimport; pkill -9 mongoexport; pkill -9 mongodump; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongofiles; pkill -9 mongooplog; pkill -9 mongotop; pkill -9 mongobridge; pkill -9 mongod-2.6; pkill -9 mongos-2.6; pkill -9 mongo-2.6; pkill -9 bsondump-2.6; pkill -9 mongoimport-2.6; pkill -9 mongoexport-2.6; pkill -9 mongodump-2.6; pkill -9 mongorestore-2.6; pkill -9 mongostat-2.6; pkill -9 mongofiles-2.6; pkill -9 mongooplog-2.6; pkill -9 mongotop-2.6; pkill -9 mongobridge-2.6; pkill -9 mongod-2.4; pkill -9 mongos-2.4; pkill -9 mongo-2.4; pkill -9 bsondump-2.4; pkill -9 mongoimport-2.4; pkill -9 mongoexport-2.4; pkill -9 mongodump-2.4; pkill -9 mongorestore-2.4; pkill -9 mongostat-2.4; pkill -9 mongofiles-2.4; pkill -9 mongooplog-2.4; pkill -9 mongotop-2.4; pkill -9 resmoke.py; pkill -9 python; pkill -9 cl; pkill -9 lldb; pkill -9 _test} >/dev/null 2>&1
exit 0
- command: archive.targz_pack
params:
target: "mongo-coredumps.tgz"
source_dir: "./"
include:
- "./**.mdmp"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-coredumps.tgz
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/coredumps/mongo-coredumps-${build_id}-${task_name}-${execution}.tgz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: Core Dumps - Execution ${execution}
optional: true
- command: shell.exec
params:
working_dir: src
script: |
# removes files from the (local) scons cache when it's over a
# threshold, to the $prune_ratio percentage. Ideally override
# these default values in the distro config in evergreen.
if [ -d "${scons_cache_path}" ]; then
${python|python} buildscripts/scons_cache_prune.py --cache-dir '${scons_cache_path}' --cache-size ${scons_cache_size|200} --prune-ratio ${scons_prune_ratio|0.8}
fi
- command: shell.exec
params:
system_log: true
working_dir: src # Temporary files created in src will be cleaned up in "pre".
script: |
${set_sudo}
# Use dmesg -T option, if supported, to display timestamps.
dmesg=dmesg
dmesg -T > /dev/null 2>&1
if [ $? -eq 0 ]; then
dmesg="dmesg -T"
fi
$sudo $dmesg 2> /dev/null > dmesg.txt
if [ $? -ne 0 ]; then
echo "Cannot check for OOM (Out of memory) killed processes on this platform"
exit 0
fi
egrep -i '(Out of memory|OOM[- ]killer|Killed process)' dmesg.txt > oom.txt
if [ -s oom.txt ]; then
echo "OOM (Out of memory) killed processes detected"
cat oom.txt
else
echo "No OOM (Out of memory) killed processes detected"
fi
- func: "cleanup environment"
timeout:
- command: shell.exec
params:
working_dir: src
script: |
echo "Calling the hang analyzer..."
PATH=/opt/mongodbtoolchain/bin:$PATH python buildscripts/hang_analyzer.py
#######################################
# Tasks #
#######################################
tasks:
## compile ##
- name: compile
depends_on: []
commands:
- command: manifest.load
- command: git.get_project
params:
directory: src
revisions: # for each module include revision as <module_name> : ${<module_name>_rev}
enterprise: ${enterprise_rev}
mongo-tools: ${mongo-tools_rev}
rocksdb: ${rocksdb_rev}
- command: git.apply_patch
params:
directory: src
- func: "get buildnumber"
- func: "setup credentials"
- func: "build new tools" # noop if ${newtools} is not "true"
- func: "build rocksdb" # noop if ${build_rocksdb} is not "true"
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
set -o verbose
# We get the raw version string (r1.2.3-45-gabcdef) from git
MONGO_VERSION=$(git describe)
# If this is a patch build, we add the patch version id to the version string so we know
# this build was a patch, and which evergreen task it came from
if [ "${is_patch|}" = "true" ]; then
MONGO_VERSION="$MONGO_VERSION-patch-${version_id}"
fi
# This script converts the generated version string into a sanitized version string for
# use by scons and uploading artifacts.
echo $MONGO_VERSION | ${python|python} buildscripts/generate_compile_expansions.py | tee compile_expansions.yml
# Then we load the generated version data into the agent so we can use it in task definitions
- command: expansions.update
params:
file: src/compile_expansions.yml
- command: shell.exec
type: test
params:
working_dir: src
script: |
set -o errexit
set -o verbose
rm -rf ${install_directory|/data/mongo-install-directory}
${python|python} ./buildscripts/scons.py ${compile_flags|} --use-new-tools all dist dist-debugsymbols distsrc-${ext|tgz} ${msi_target|} MONGO_VERSION=${version}
mv mongodb-src-*.${ext|tgz} distsrc.${ext|tgz}
mv mongodb-*-debugsymbols.${ext|tgz} mongo-debugsymbols.tgz || true
mv mongodb-*.${ext|tgz} mongodb-binaries.tgz
# If strip is on the path (everywhere except windows) then we should strip the test binaries
# before tarring them up
if [ -x ${strip_path|/usr/bin/strip} ]; then
cat build/unittests.txt | xargs ${strip_command|/usr/bin/strip}
cat build/integration_tests.txt | xargs ${strip_command|/usr/bin/strip}
${strip_command|/usr/bin/strip} dbtest
${strip_command|/usr/bin/strip} mongobridge
fi
# On windows we need to make sure the paths in unittests.txt are compatible with cygwin tar
sed 's|\\|/|g' build/unittests.txt > build/unittests-tarlist.txt
${tar|tar} -czvf mongodb-unittests.tgz -T build/unittests-tarlist.txt build/unittests.txt
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
set -o verbose
if [ "${has_packages|}" = "true" ] ; then
cd buildscripts
${python|python} ${packager_script} --prefix `pwd`/.. --distros ${packager_distro} --tarball `pwd`/../mongodb-binaries.tgz -s ${version} -m HEAD -a ${packager_arch}
cd ..
fi
# Create separate shell archive
mkdir -p shell-archive/build
cd shell-archive
${platform_decompress|tar xzvf} ../mongodb-binaries.tgz
find . -mindepth 3 ! -name "mongo${exe}" -type f -exec rm {} \; # delete bin/* except bin/mongo
${python|python} ../buildscripts/make_archive.py -o mongodb-shell.${ext|tgz} $(find mongodb-* -type f)
cd ..
- command: archive.targz_pack
params:
target: "artifacts.tgz"
source_dir: "src"
include:
- "src/mongo/db/modules/enterprise/jstests/**"
- "compile_expansions.yml"
- "src/mongo/db/modules/subscription/jstests/**"
- "src/mongo/db/modules/enterprise/docs/**"
- "*.exe"
- "jstests/**"
- "./test*"
- "./dbtest*"
- "./mongobridge*"
- "buildscripts/**"
- "*Example"
- "*Test"
- "./**.pdb"
- "./**.msi"
- "./etc/*san.suppressions"
- "./etc/repo_config.yaml"
- "./build/integration_tests/**"
- "./build/integration_tests.txt"
- "repo/**"
- "src/mongo/util/options_parser/test_config_files/**"
exclude_files:
- "*_test.pdb"
- func: "upload debugsymbols"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/mongodb-binaries.tgz
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/binaries/mongo-${build_id}.${ext|tgz}
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: Binaries
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/shell-archive/mongodb-shell.${ext|tgz}
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/binaries/mongo-shell-${build_id}.${ext|tgz}
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: Shell
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: artifacts.tgz
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/artifacts/${build_id}.tgz
bucket: mciuploads
permissions: public-read
content_type: application/tar
display_name: Artifacts
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/mongodb-unittests.tgz
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/unittests/${build_id}.tgz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: Unit tests (stripped)
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/distsrc.${ext|tgz}
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/sources/mongo-src-${build_id}.${ext|tgz}
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: Source tarball
# We only need to upload the source tarball from one of the build variants
# because it should be the same everywhere, so just use linux-64/windows-64-2k8.
build_variants: [ linux-64, windows-64-2k8 ]
## lint ##
- name: lint
depends_on: []
commands:
- command: manifest.load
- command: git.get_project
params:
directory: src
revisions: # for each module include revision as <module_name> : ${<module_name>_rev}
enterprise: ${enterprise_rev}
mongo-tools: ${mongo-tools_rev}
rocksdb: ${rocksdb_rev}
- command: git.apply_patch
params:
directory: src
- command: shell.exec
type: test
params:
working_dir: src
script: |
set -o errexit
set -o verbose
${python|python} ./buildscripts/scons.py ${compile_flags|} --stack-size=1024 lint
## jstestfuzz mmapv1 ##
- <<: *jstestfuzz_template
name: jstestfuzz
commands:
- func: "do setup"
- func: "run jstestfuzz"
- <<: *run_jstestfuzz_tests
vars:
resmoke_args: --suites=jstestfuzz --storageEngine=mmapv1
should_shuffle: false
continue_on_failure: false
## jstestfuzz WT ##
- <<: *jstestfuzz_template
name: jstestfuzz_WT
commands:
- func: "do setup"
- func: "run jstestfuzz"
- <<: *run_jstestfuzz_tests
vars:
resmoke_args: --suites=jstestfuzz --storageEngine=wiredTiger
should_shuffle: false
continue_on_failure: false
## jstestfuzz replica set ##
- <<: *jstestfuzz_template
name: jstestfuzz_replication_WT
commands:
- func: "do setup"
- func: "run jstestfuzz"
- <<: *run_jstestfuzz_tests
vars:
resmoke_args: --suites=jstestfuzz_replication --storageEngine=wiredTiger
should_shuffle: false
continue_on_failure: false
## jstestfuzz sharded cluster ##
- <<: *jstestfuzz_template
name: jstestfuzz_sharded_WT
commands:
- func: "do setup"
- func: "run jstestfuzz"
- <<: *run_jstestfuzz_tests
vars:
resmoke_args: --suites=jstestfuzz_sharded --storageEngine=wiredTiger
should_shuffle: false
continue_on_failure: false
## unit tests ##
- <<: *task_template
name: unittests
commands:
- func: "do setup"
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongodb-mongo-v3.2/${build_variant}/${revision}/unittests/${build_id}.tgz
bucket: mciuploads
extract_to: src
- func: "run tests"
vars:
resmoke_args: --suites=unittests
run_multiple_jobs: true
## integration test suites ##
- <<: *task_template
name: aggregation
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=aggregation --storageEngine=mmapv1
run_multiple_jobs: true
- <<: *task_template
name: aggregation_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=aggregation --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: aggregation_WT_ese
depends_on:
- name: jsCore_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=aggregation_ese --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: aggregation_auth
depends_on:
- name: aggregation_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=aggregation_auth
run_multiple_jobs: true
- <<: *task_template
name: aggregation_read_concern_majority_passthrough_WT
depends_on:
- name: aggregation_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=aggregation_read_concern_majority_passthrough --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: audit
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=audit --storageEngine=mmapv1
run_multiple_jobs: true
- <<: *task_template
name: audit_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=audit --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: auth
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=auth --storageEngine=mmapv1
run_multiple_jobs: true
- <<: *task_template
name: auth_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=auth --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: auth_audit
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=auth_audit --storageEngine=mmapv1
run_multiple_jobs: true
- <<: *task_template
name: auth_audit_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=auth_audit --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: dbtest
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=dbtest --storageEngine=mmapv1
run_multiple_jobs: true
- <<: *task_template
name: dbtest_WT
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=dbtest --storageEngine=wiredTiger
run_multiple_jobs: true
- <<: *task_template
name: disk
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=disk
run_multiple_jobs: true
- <<: *task_template
name: durability
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=durability
run_multiple_jobs: true
- <<: *task_template
name: dur_jscore_passthrough
depends_on:
- name: jsCore
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=dur_jscore_passthrough
run_multiple_jobs: true
- <<: *task_template
name: ese_WT
commands:
- func: "do setup"
- func: "set up virtualenv"
- command: shell.exec
type: test
params:
working_dir: src
script: |
set -o errexit
set -o verbose
if [ "Windows_NT" = "$OS" ]; then
. ./venv/Scripts/activate
else
. ./venv/bin/activate
fi