forked from mongodb/mongo-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.yml
2281 lines (2152 loc) · 61.5 KB
/
common.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
#######################################
# 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:
## List of tests to run on each buildvariant
mongo_tools_task_lists:
mac_task_list: &macos_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: qa-tests-3.2
- name: qa-tests-3.4
- name: qa-tests-3.6
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: qa-dump-restore-with-gzip-current
- name: qa-dump-restore-with-archiving-current
- name: unit
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2107
# - name: replay-replay_test-4.2
macos_ssl_task_list: &macos_ssl_tasks
- name: dist
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: unit
- name: replay-dist
rhel_x86_64_task_list: &rhel_x86_64_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: legacy30
- name: lint-go
- name: format-go
- name: lint-js
- name: qa-tests-3.2
- name: qa-tests-3.4
- name: qa-tests-3.6
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: qa-dump-restore-with-gzip-current
- name: qa-dump-restore-with-archiving-current
- name: unit
- name: vet
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2116
# - name: replay-replay_test-4.2
rhel_x86_64_ssl_task_list: &rhel_x86_64_ssl_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
rhel_x86_64_enterprise_task_list: &rhel_x86_64_enterprise_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
# Disabled due to TOOLS-2119
# - name: kerberos
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2116
# - name: replay-replay_test-4.2
ubuntu_x86_64_task_list: &ubuntu_x86_64_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: lint-go
- name: format-go
- name: lint-js
- name: qa-tests-3.2
- name: qa-tests-3.4
- name: qa-tests-3.6
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: qa-dump-restore-with-gzip-current
- name: qa-dump-restore-with-archiving-current
- name: unit
- name: vet
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2108
# - name: replay-replay_test-4.2
ubuntu_x86_64_ssl_task_list: &ubuntu_x86_64_ssl_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
ubuntu_x86_64_enterprise_task_list: &ubuntu_x86_64_enterprise_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: kerberos
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2108
# - name: replay-replay_test-4.2
ubuntu_x86_64_race_task_list: &ubuntu_x86_64_race_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: unit
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2108
# - name: replay-replay_test-4.2
windows_64_task_list: &windows_64_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
distros:
- windows-64-vs2017-test
- name: qa-tests-3.2
distros:
- windows-64-vs2017-test
- name: qa-tests-3.4
distros:
- windows-64-vs2017-test
- name: qa-tests-3.6
distros:
- windows-64-vs2017-test
- name: qa-tests-4.0
distros:
- windows-64-vs2017-test
- name: qa-tests-4.2
distros:
- windows-64-vs2017-test
- name: qa-dump-restore-with-archiving-current
distros:
- windows-64-vs2017-test
- name: qa-dump-restore-with-gzip-current
distros:
- windows-64-vs2017-test
- name: qa-tests-unstable
- name: unit
windows_64_ssl_task_list: &windows_64_ssl_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: unit
windows_64_enterprise_task_list: &windows_64_enterprise_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
- name: kerberos
distros:
- windows-64-vs2017-test
- name: qa-tests-3.2
distros:
- windows-64-vs2017-test
- name: qa-tests-3.4
distros:
- windows-64-vs2017-test
- name: qa-tests-3.6
distros:
- windows-64-vs2017-test
- name: qa-tests-4.0
distros:
- windows-64-vs2017-test
- name: qa-tests-4.2
distros:
- windows-64-vs2017-test
- name: qa-tests-unstable
distros:
- windows-64-vs2017-test
- name: unit
- name: native-cert-ssl-current
rhel71_ppc64le_enterprise_task_list: &rhel71_ppc64le_enterprise_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
#- name: kerberos
- name: qa-dump-restore-with-archiving-current
- name: qa-dump-restore-with-gzip-current
- name: qa-tests-3.4
- name: qa-tests-3.6
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2108
# - name: replay-replay_test-4.2
rhel67_s390x_enterprise_task_list: &rhel67_s390x_enterprise_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: integration-4.2
- name: integration-4.2-auth
# Disabled due to TOOLS-2119
# - name: kerberos
- name: qa-dump-restore-with-archiving-current
- name: qa-dump-restore-with-gzip-current
- name: qa-tests-3.4
- name: qa-tests-3.6
- name: qa-tests-4.0
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
- name: replay-sanity_check-4.2
- name: replay-go_test-4.2
- name: replay-auth_test-4.2
- name: replay-sharded_test-4.2
- name: replay-repl_test-4.2
# Disabled due to TOOLS-2108
# - name: replay-replay_test-4.2
ubuntu1604_arm64_ssl_task_list: &ubuntu1604_arm64_ssl_tasks
- name: dist
- name: integration-4.0
- name: integration-4.0-auth
- name: qa-tests-3.4
- name: qa-tests-3.6
- name: qa-tests-4.0
- name: replay-dist
ubuntu1804_arm64_ssl_task_list: &ubuntu1804_arm64_ssl_tasks
- name: dist
- name: integration-4.2
- name: integration-4.2-auth
- name: qa-dump-restore-with-archiving-current
- name: qa-dump-restore-with-gzip-current
- name: qa-tests-4.2
- name: qa-tests-unstable
- name: native-cert-ssl-current
- name: replay-dist
## 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 testdata/certs/ca.pem --sslPEMKeyFile testdata/certs/server.pem"
mongod_port: 33333
# Set storage engine as mmapv1 for 32 bit variants because WiredTiger requires 64 bit support.
win32: &mongod_win32_startup_args
mongod_args: "--storageEngine=mmapv1"
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 ./testdata/certs/ca.pem --sslPEMKeyFile ./testdata/certs/server.pem --sslAllowInvalidCertificates"
mongod_port: 33333
functions:
"run legacy tests":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
chmod +x bin/*
mv bin/* ${test_path}/
cd ${test_path}
python buildscripts/smoke.py ${smoke_use_ssl} --with-cleanbb --mongod ./mongod --mongo ./mongo --report-file ../../report.json --continue-on-failure --buildlogger-builder MCI_${build_variant} --buildlogger-buildnum ${builder_num|} --buildlogger-credentials ./mci.buildlogger --buildlogger-phase ${task_name}_${execution} ${smoke_args} tool
"run qa-tests":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
chmod +x bin/*
mv bin/* test/qa-tests/
cd test/qa-tests
chmod 400 jstests/libs/key*
python buildscripts/resmoke.py --suite=${resmoke_suite} --continueOnFailure --log=buildlogger --reportFile=../../report.json ${resmoke_args} --excludeWithAnyTags="${excludes}"
"build tool":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
echo "Building ${tool}..."
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
fi;
# In RHEL 5.5, /usr/bin/ld can't handle --build-id parameters, so
# use a wrapper if it's present on the system
#
if [ -d /opt/ldwrapper/bin ]
then
export PATH=/opt/ldwrapper/bin:$PATH
fi
. ./set_goenv.sh
GOROOT="" set_goenv || exit
go version
env | grep ^GO
go build $(buildflags) -ldflags "$(print_ldflags)" ${args} -tags "$(print_tags failpoints ${build_tags})" -o bin/${tool} ${tool}/main/${tool}.go
./bin/${tool} --version
"download mongod":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
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-*
"fetch tool" :
command: s3.get
params:
bucket: mciuploads
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/bin/${tool}${extension}
remote_file: mongo-tools/binaries/${build_id}/${edition|community}/${tool}${extension}
"generate coverage html + text":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
if [ "${coverage}" = "true" ]; then
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
fi;
go tool cover -html=coverage.out -o coverage.html
go tool cover -func=coverage.out -o coverage.txt
fi;
"get buildnumber":
command: keyval.inc
params:
key: "${build_variant}_tools"
destination: "builder_num"
"move coverage data":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
if [ "${coverage}" = "true" ]; then
mv ${package}/coverage.out .
fi
"run unit test":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
# export sensitive info before `set -x`
export MONGODB_KERBEROS_PASSWORD=${kerberos_password}
set -x
set -v
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
fi;
export basedir=$PWD
. ./set_goenv.sh
GOROOT="" set_goenv || exit
cd ${package}
go test $(buildflags) -ldflags "$(print_ldflags)" ${coverage_args} -tags "$(print_tags ${build_tags})" -test.v > unit.suite
export exitcode=$?
cat unit.suite
cp unit.suite $basedir/.
exit $exitcode
"setup integration test":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
# 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
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 [ "${run_coverage}" = "true" ]; then
export RUN_COVERAGE="true"
fi
export ON_EVERGREEN="true"
export TOOLS_BUILD_TAGS=${build_tags}
./runTests.sh -v
exit $?
"run tool integration tests":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
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 [ "${KERBEROS_TEST}" = "true" ]; then
export TOOLS_TESTING_KERBEROS="true"
elif [ "${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 [ "${INT_TEST}" = "true" ]; then
export TOOLS_TESTING_INTEGRATION="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"
export TOOLS_BUILD_TAGS="${build_tags}"
./runTests.sh -v
exit $?
"create coverage reports":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
set -o verbose
if [ "Windows_NT" = "$OS" ]; then
set -o igncr
fi;
. ./set_goenv.sh
GOROOT="" set_goenv || exit
# XXX Need to fix up use of 'src' below somehow; for now commented out
# because we're using an actual GOPATH instead of a hack and replaced with a copy
for i in mongoimport mongoexport mongostat mongorestore mongodump mongofiles; do
cd $i
# perl -pe 's/.*src/github.com\/mongodb\/mongo-tools/' coverage_$i.out > coverage_$i_rewrite.out
go tool cover -html=coverage_$i.out -o coverage_$i.html
go tool cover -func=coverage_$i.out -o coverage_$i.txt
cd ..
done
"upload html coverage":
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/${coverage_pkg}/coverage_${coverage_pkg}.html
remote_file: mongo-tools/coverage/${coverage_pkg}/${task_id}.html
bucket: mciuploads
permissions: public-read
content_type: text/html
build_variants: ["ubuntu", "windows-64"]
display_name: ${coverage_pkg}-html
"upload text coverage":
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/${coverage_pkg}/coverage_${coverage_pkg}.txt
remote_file: mongo-tools/coverage/${coverage_pkg}/${task_id}.txt
bucket: mciuploads
permissions: public-read
content_type: text/plain
build_variants: ["ubuntu", "windows-64"]
display_name: ${coverage_pkg}-text
"setup credentials" :
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
silent: true
script: |
set -x
set -v
set -e
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
# Resmoke hardcodes the location of this file so we need to copy it to the working directory
# we run resmoke from.
cp mci.buildlogger test/qa-tests
"start mongod":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
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
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
"upload tool":
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/bin/${tool}
remote_file: mongo-tools/binaries/${build_id}/${edition|community}/${tool}${extension}
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
display_name: ${tool}
"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
- command: git.apply_patch
params:
directory: src/github.com/mongodb/mongo-tools
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
mkdir -p bin
"upload archive" :
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/${filename}
remote_file: mongo-tools/mongoreplay/archive/${build_id}/${filename}
bucket: mciuploads
permissions: public-read
content_type: application/gzip
display_name: ${filename}
"create timeseries" :
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
git clone git@github.com:10gen/support-tools
sudo pip install argparse python-dateutil pytz
python support-tools/timeseries/timeseries.py /data/mongoreplay/diagnostic.data --html timeseries.html
"upload timeseries" :
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/timeseries.html
remote_file: mongo-tools/mongoreplay/timeseries/${build_id}/timeseries.html
bucket: mciuploads
permissions: public-read
content_type: text/html
display_name: timeseries.html
"fetch pcap" :
command: s3.get
params:
bucket: boxes.10gen.com
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/mongoreplay/testPcap/${pcapFname}
remote_file: build/mongotape/${pcapFname}
"fetch ftdc" :
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
GOPATH=$PWD go get github.com/10gen/ftdc-utils/cmd/ftdc
"fetch golangci-lint" :
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
"create auth_user" :
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
./bin/mongo --port ${mongod_port} admin --eval "db.createUser({user:\"authorizedUser\", pwd: \"authorizedPwd\", roles:[\"readWriteAnyDatabase\", \"clusterManager\"]});"
"create sharded_cluster" :
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
background: true
script: |
set -x
set -v
set -e
echo "starting sharded cluster"
mkdir -p /data/db/
PATH=./bin:$PATH ./bin/mongo --nodb --eval 'var d = new ShardingTest({shards:3, mongos:[{port:${mongod_port}}]}); while(true){sleep(1000)}'
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
./bin/mongo --nodb --eval 'var d; assert.soon(function(x){try{d = new Mongo("localhost:${mongod_port}"); return true} catch(e){return false}}, "timed out connection");d.setLogLevel(5, "write");'
"create repl_set" :
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
background: true
script: |
set -x
set -v
set -e
echo "starting repl set"
mkdir -p /data/db/
PATH=./bin:$PATH ./bin/mongo --nodb --eval 'TestData = new Object(); TestData.minPort="${mongod_port}"; var repl = new ReplSetTest({nodes:3, name:"repltester"});repl.startSet();repl.initiate();repl.awaitSecondaryNodes();while(true){sleep(1000);}'
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
./bin/mongo --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:${mongod_port}"); return true} catch(e){return false}}, "timed out connection")'
"run replay go_test" :
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
. ./set_goenv.sh
GOROOT="" set_goenv || exit
if [ "${TESTING_REPLAY}" = "true" ]; then
export TOOLS_TESTING_REPLAY="true"
fi
${environment_vars} go test $(buildflags) -ldflags "$(print_ldflags)" ${additional_args} -v > ${filename}.suite
pre:
- command: shell.exec
params:
silent: true
script: |
set -x
set -v
${killall_mci|pkill -9 mongo; pkill -9 mongodump; pkill -9 mongoexport; pkill -9 mongoimport; pkill -9 mongofiles; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongotop; pkill -9 mongod; pkill -9 mongos; pkill -f buildlogger.py; pkill -f smoke.py} >/dev/null 2>&1
rm -rf src /data/db/*
exit 0
post:
# attach.results works for jstests, gotest.parse_files for golang tests
- command: attach.results
params:
file_location: src/github.com/mongodb/mongo-tools/report.json
- command: gotest.parse_files
params:
files: ["src/github.com/mongodb/mongo-tools/testing_output/*.suite"]
- command: shell.exec
params:
silent: true
script: |
set -x
set -v
${killall_mci|pkill -9 mongo; pkill -9 mongodump; pkill -9 mongoexport; pkill -9 mongoimport; pkill -9 mongofiles; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongotop; pkill -9 mongod; pkill -9 mongos; pkill -f buildlogger.py; pkill -f smoke.py} >/dev/null 2>&1
exit 0
- command: shell.exec
params:
script: |
set -x
set -v
rm -rf /data/db/*
exit 0
timeout:
- command: shell.exec
params:
silent: true
script: |
set -x
set -v
# don't attempt to abort on any distro which has a special way of
# killing everything (i.e. using taskkill on Windows)
if [ "${killall_mci}" = "" ]; then
all_tools="bsondump mongodump mongoexport mongofiles mongoimport mongorestore mongostat mongotop"
# send SIGABRT to print a stacktrace for any hung tool
pkill -ABRT "^($(echo -n $all_tools | tr ' ' '|'))\$"
# git the processes a second or two to dump their stacks
sleep 10
fi
tasks:
- name: dist
depends_on:
commands:
- func: "fetch source"
# bsondump
- func: "build tool"
vars:
tool: bsondump
- func: "upload tool"
vars:
tool: bsondump
# mongodump
- func: "build tool"
vars:
tool: mongodump
- func: "upload tool"
vars:
tool: mongodump
# mongoexport
- func: "build tool"
vars:
tool: mongoexport
- func: "upload tool"
vars:
tool: mongoexport
# mongofiles
- func: "build tool"
vars:
tool: mongofiles
- func: "upload tool"
vars:
tool: mongofiles
# mongoimport
- func: "build tool"
vars:
tool: mongoimport
- func: "upload tool"
vars:
tool: mongoimport
# mongorestore
- func: "build tool"
vars:
tool: mongorestore
- func: "upload tool"
vars:
tool: mongorestore
# mongostat
- func: "build tool"
vars:
tool: mongostat
- func: "upload tool"
vars:
tool: mongostat
# mongotop
- func: "build tool"
vars:
tool: mongotop
- func: "upload tool"
vars:
tool: mongotop
- 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"
- name: integration-4.0-auth
commands:
- func: "fetch source"
# Concat auth args
- command: expansions.update
params:
updates:
- key: "mongod_args"
concat: " --auth"