forked from mongodb/mongo-cxx-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mci.yml
1837 lines (1680 loc) · 65 KB
/
.mci.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
#######################################
# CXX Driver Config for MCI #
#######################################
exec_timeout_secs: 3600
#######################################
# Variables #
#######################################
variables:
# If updating mongoc_version_minimum, also update:
# - the default value of --c-driver-build-ref in etc/make_release.py
# - LIBMONGOC_REQUIRED_VERSION in src/mongocxx/CMakeLists.txt
mongoc_version_minimum: &mongoc_version_minimum "1.25.0"
integration_matrix:
integration_matrix_tasks_single: &integration_matrix_tasks_single
tasks:
- name: compile_and_test_with_shared_libs
- name: compile_and_test_with_shared_libs_extra_alignment
integration_matrix_tasks_replica: &integration_matrix_tasks_replica
tasks:
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
integration_matrix_tasks_sharded: &integration_matrix_tasks_sharded
tasks:
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
integration_matrix_auth_tasks_single: &integration_matrix_auth_tasks_single
tasks:
- name: compile_and_test_auth_with_shared_libs
integration_matrix_versioned_api_tasks_single: &integration_matrix_versioned_api_tasks_single
tasks:
- name: test_versioned_api
- name: test_versioned_api_accept_version_two
# "Drivers MUST run all tests with mongocryptd on at least one platform for all tested server versions (4.2+)."
integration_matrix_mongocryptd_tasks: &integration_matrix_mongocryptd_tasks
tasks:
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
integration_matrix_expansions_linux: &integration_matrix_expansions_linux
build_type: "Debug"
ENABLE_CODE_COVERAGE: ON
integration_matrix_expansions_windows: &integration_matrix_expansions_windows
build_type: "Debug" # Same for Windows and Linux
generator: Visual Studio 15 2017 Win64
example_projects_cxx_standard: 17
#######################################
# Functions #
#######################################
functions:
"setup":
- command: shell.exec
params:
shell: bash
script: |
set -o errexit
set -o pipefail
rm -rf "mongo-cxx-driver"
rm -fr "mongo-c-driver"
rm -fr mongod
rm -fr drivers-evergreen-tools
- command: git.get_project
params:
directory: "mongo-cxx-driver"
- command: shell.exec
params:
shell: bash
working_dir: "."
script: |
set -o errexit
set -o pipefail
cc --version || true
c++ --version || true
gcc --version || true
g++ --version || true
clang --version || true
cmake --version || true
openssl version || true
"build_mongohouse":
command: shell.exec
params:
shell: bash
script: |
if [ ! -d "drivers-evergreen-tools" ]; then
git clone git@github.com:mongodb-labs/drivers-evergreen-tools.git
fi
cd drivers-evergreen-tools
export DRIVERS_TOOLS=$(pwd)
sh .evergreen/atlas_data_lake/build-mongohouse-local.sh
"run_mongohouse":
command: shell.exec
params:
shell: bash
background: true
script: |
cd drivers-evergreen-tools
export DRIVERS_TOOLS=$(pwd)
sh .evergreen/atlas_data_lake/run-mongohouse-local.sh
"test_mongohouse":
command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |
echo "testing that mongohouse is running..."
ps aux | grep mongohouse
cd build
export PREFIX=$(pwd)/../../mongoc
# Use LD_LIBRARY_PATH to inform the tests where to find dependencies on Linux.
# This task only runs on Linux.
if [ -n "${lib_dir}" ]; then
export LD_LIBRARY_PATH=.:$PREFIX/${lib_dir}/
else
export LD_LIBRARY_PATH=.:$PREFIX/lib/
fi
export MONGOHOUSE_TESTS_PATH="$(pwd)/../data/mongohouse"
ulimit -c unlimited || true
./src/mongocxx/test/test_mongohouse_specs
"start_mongod":
- command: shell.exec
params:
shell: bash
working_dir: "."
script: |
set -o errexit
set -o pipefail
if [ ! -d "drivers-evergreen-tools" ]; then
git clone git@github.com:mongodb-labs/drivers-evergreen-tools.git
fi
cd drivers-evergreen-tools
# The legacy shell is only present in server 5.0 builds and earlier,
# but there is no 5.0 build for RHEL9, so we have to avoid it
if [[ "${build_variant}" =~ "rhel9" ]]; then
export SKIP_LEGACY_SHELL=1
fi
export DRIVERS_TOOLS=$(pwd)
if [ "Windows_NT" == "$OS" ]; then
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
fi
export MONGODB_BINARIES=$DRIVERS_TOOLS/mongodb/bin
export MONGO_ORCHESTRATION_HOME=$DRIVERS_TOOLS/.evergreen/orchestration
export MONGODB_VERSION=${mongodb_version}
export AUTH=${AUTH}
export TOPOLOGY=${TOPOLOGY|server}
export REQUIRE_API_VERSION=${REQUIRE_API_VERSION}
export ORCHESTRATION_FILE=${ORCHESTRATION_FILE}
export PATH="$MONGODB_BINARIES:$PATH"
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config
./.evergreen/run-orchestration.sh
# Ensure server on port 27017 is the primary server.
if [[ "$TOPOLOGY" == replica_set ]]; then
# Replset members should be on the following ports.
declare hosts="localhost:27017,localhost:27018,localhost:27019"
# Authentication may be required.
declare creds
if [[ -n "$AUTH" ]]; then
creds="bob:pwd123@"
else
creds=""
fi
declare uri
printf -v uri "mongodb://%s%s" "$creds" "$hosts"
# Raise the priority of the member on port 27017. Others should have priority 1.
declare script
printf -v script "%s\n%s\n%s\n" \
"let c = rs.conf()" \
"c.members.find((m) => m.host.includes('27017')).priority = 10" \
"rs.reconfig(c)"
mongosh --quiet "$uri" --eval "$script"
# Wait up to a minute for member on port 27017 to become primary.
wait_for_primary() {
for _ in $(seq 60); do
if mongosh --quiet "$uri" --eval "quit(rs.hello().primary.includes('27017') ? 0 : 1)"; then
return 0
else
sleep 1
fi
done
echo "Could not set replset member on port 27017 as primary"
return 1
}
echo "Waiting for replset member 27017 to become primary..."
wait_for_primary
echo "Waiting for replset member 27017 to become primary... done."
fi
# Copy mongocryptd up so other functions can find it later, since we can't share PATHs
if [ -f $MONGODB_BINARIES/mongocryptd ]; then
cp $MONGODB_BINARIES/mongocryptd ../mongocryptd
fi
cd ../
pwd
- command: expansions.update
params:
type: setup
file: drivers-evergreen-tools/mo-expansion.yml
"stop_mongod":
command: shell.exec
params:
shell: bash
working_dir: "."
script: |
set -o errexit
set -o pipefail
if cd drivers-evergreen-tools/.evergreen/orchestration; then
. ../venv-utils.sh
if venvactivate venv; then
mongo-orchestration stop
fi
fi
"install_c_driver":
- command: expansions.update
type: setup
params:
updates:
- key: mongoc_version_minimum
value: *mongoc_version_minimum
- command: shell.exec
type: setup
params:
shell: bash
add_expansions_to_env: true
script: mongo-cxx-driver/.evergreen/install_c_driver.sh
# fetch_c_driver_source may be used to fetch the C driver source without installing the C driver.
# This can be used when only CI scripts are needed.
"fetch_c_driver_source":
- command: shell.exec
params:
shell: bash
working_dir: "."
script: |
set -o errexit
set -o pipefail
git clone --depth 1 https://github.com/mongodb/mongo-c-driver mongoc
"lint":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |
set -o errexit
set -o pipefail
python etc/clang_format.py lint
"clang-tidy":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
include_expansions_in_env:
- distro_id
env:
CC: ${cc_compiler}
CXX: ${cxx_compiler}
script: ./etc/run-clang-tidy.sh
"clone_drivers-evergreen-tools":
- command: shell.exec
params:
shell: bash
script: |-
set -o errexit
if [ ! -d "drivers-evergreen-tools" ]; then
git clone git@github.com:mongodb-labs/drivers-evergreen-tools.git --depth=1
fi
echo "DRIVERS_TOOLS: $(pwd)/drivers-evergreen-tools" > det-expansion.yml
# Set DRIVERS_TOOLS expansion.
- command: expansions.update
params:
file: det-expansion.yml
"run_kms_servers":
- command: shell.exec
params:
shell: bash
script: |-
set -o errexit
echo "Preparing CSFLE venv environment..."
cd ./drivers-evergreen-tools/.evergreen/csfle
# This function ensures future invocations of activate-kmstlsvenv.sh conducted in
# parallel do not race to setup a venv environment; it has already been prepared.
# This primarily addresses the situation where the "test" and "run_kms_servers"
# functions invoke 'activate-kmstlsvenv.sh' simultaneously.
if [[ "$OSTYPE" =~ cygwin && ! -d kmstlsvenv ]]; then
# Avoid using Python 3.10 on Windows due to incompatible cipher suites.
# See CXX-2628.
. ../venv-utils.sh
venvcreate "C:/python/Python39/python.exe" kmstlsvenv || # windows-2017
venvcreate "C:/python/Python38/python.exe" kmstlsvenv # windows-2015
python -m pip install --upgrade boto3~=1.19 pykmip~=0.10.0 "sqlalchemy<2.0.0"
deactivate
else
. ./activate-kmstlsvenv.sh
deactivate
fi
echo "Preparing CSFLE venv environment... done."
- command: shell.exec
params:
background: true
shell: bash
script: |-
set -o errexit
echo "Starting mock KMS servers..."
cd ./drivers-evergreen-tools/.evergreen/csfle
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8999 &
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 9000 &
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 9001 &
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 9002 --require_client_cert &
python -u kms_kmip_server.py &
echo "Starting mock KMS servers... done."
"compile":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
include_expansions_in_env:
- branch_name
- build_type
- COMPILE_MACRO_GUARD_TESTS
- distro_id
- ENABLE_CODE_COVERAGE
- ENABLE_TESTS
- generator
- REQUIRED_CXX_STANDARD
- RUN_DISTCHECK
- USE_POLYFILL_BOOST
- USE_POLYFILL_STD_EXPERIMENTAL
- USE_SANITIZER_ASAN
- USE_SANITIZER_UBSAN
- USE_STATIC_LIBS
env:
CC: ${cc_compiler}
CXX: ${cxx_compiler}
script: .evergreen/compile.sh
"test":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
include_expansions_in_env:
- build_type
- CRYPT_SHARED_LIB_PATH # Set by run-orchestration.sh in "start_mongod".
- cse_aws_access_key_id
- cse_aws_secret_access_key
- cse_azure_client_id
- cse_azure_client_secret
- cse_azure_tenant_id
- cse_gcp_email
- cse_gcp_privatekey
- disable_slow_tests
- distro_id
- example_projects_cc
- example_projects_cxx
- example_projects_cxx_standard
- example_projects_cxxflags
- example_projects_ldflags
- generator
- lib_dir
- MONGODB_API_VERSION
- TEST_WITH_ASAN
- TEST_WITH_UBSAN
- TEST_WITH_VALGRIND
- use_mongocryptd
- USE_STATIC_LIBS
script: .evergreen/test.sh
"test auth":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |
export MONGOC_INSTALL_PREFIX=$(pwd)/../mongoc
export MONGOCXX_INSTALL_PREFIX=$(pwd)/build/install
export LIB_DIR=${lib_dir}
export BUILD_TYPE=${build_type}
export BUILD_DIR=$(pwd)/build
export URI="mongodb://bob:pwd123@localhost"
./.evergreen/connect.sh
"test atlas connectivity":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
silent: true
script: |
export MONGOC_INSTALL_PREFIX=$(pwd)/../mongoc
export MONGOCXX_INSTALL_PREFIX=$(pwd)/build/install
export LIB_DIR=${lib_dir}
export BUILD_TYPE=${build_type}
export BUILD_DIR=$(pwd)/build
# The atlas_serverless_uri expansion is set in the Evergreen project settings.
export URI="${atlas_serverless_uri}"
./.evergreen/connect.sh
"backtrace":
- command: shell.exec
params:
working_dir: "mongo-cxx-driver"
script: |
./etc/debug-core-evergreen.sh
"upload working dir":
- command: archive.targz_pack
params:
target: "working-dir.tar.gz"
source_dir: "mongo-cxx-driver"
include:
- "./**"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: working-dir.tar.gz
remote_file: mongo-cxx-driver/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-working-dir.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "working-dir.tar.gz"
"upload mongo orchestration artifacts":
- command: shell.exec
params:
working_dir: "."
script: |
find . -name \*.log | xargs tar czf mongodb-logs.tar.gz
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongodb-logs.tar.gz
remote_file: mongo-cxx-driver/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "mongodb-logs.tar.gz"
"upload code coverage":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |
set -o errexit
set -o pipefail
# Nothing to do if code coverage was not enabled.
if [[ "${ENABLE_CODE_COVERAGE}" != "ON" ]]; then
exit 0
fi
# Note: coverage is currently only enabled on the ubuntu-1804 distro.
# This script does not support MacOS, Windows, or non-x86_64 distros.
# Update accordingly if code coverage is expanded to other distros.
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
# -Z: Exit with a non-zero value if error.
# -g: Run with gcov support.
# -t: Codecov upload token.
# perl: filter verbose "Found" list and "Processing" messages.
./codecov -Zgt "${codecov_token}" | perl -lne 'print if not m|(^.*\.gcov(\.\.\.)?$)|'
"docker-image-build":
- command: shell.exec
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |
set -o errexit
set -o pipefail
set -x
# TODO: Re-enable Alpine test once MONGOCRYPT-601 is released.
# echo "Building Alpine Docker image"
# make -C extras/docker/alpine3.18 nocachebuild test
echo "Building Debian Docker image"
make -C extras/docker/bookworm nocachebuild test
echo "Building Red Hat UBI Docker image"
make -C extras/docker/redhat-ubi-9.3 nocachebuild test
#######################################
# Post Task #
#######################################
post:
- func: "stop_mongod"
- func: "backtrace"
# Workaround for CXX-2040
# - func: "upload working dir"
- func: "upload mongo orchestration artifacts"
- func: "upload code coverage"
#######################################
# Tasks #
#######################################
tasks:
- name: lint
run_on: ubuntu1804-large
commands:
- func: "setup"
- func: "lint"
- name: clang-tidy
commands:
- func: "setup"
- func: "install_c_driver"
- func: "clang-tidy"
- name: compile_and_test_with_shared_libs
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
# Call "install_c_driver" before "test" to build static C driver libraries. Example projects require static C driver libraries.
- func: "install_c_driver"
- func: "test"
- name: compile_and_test_with_shared_libs_extra_alignment
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "compile"
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "test"
- name: compile_and_test_with_shared_libs_cxx20
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
REQUIRED_CXX_STANDARD: 20
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
vars:
REQUIRED_CXX_STANDARD: 20
example_projects_cxx_standard: 20
- name: compile_and_test_with_shared_libs_extra_alignment_cxx20
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "compile"
vars:
REQUIRED_CXX_STANDARD: 20
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "test"
vars:
REQUIRED_CXX_STANDARD: 20
example_projects_cxx_standard: 20
- name: compile_with_shared_libs
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
- func: "compile"
- name: compile_without_tests
commands:
- func: "setup"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
ENABLE_TESTS: OFF
- name: compile_macro_guard_tests
commands:
- func: "setup"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
COMPILE_MACRO_GUARD_TESTS: ON
- name: compile_and_test_auth_with_shared_libs
commands:
- func: "setup"
- func: "start_mongod"
vars:
AUTH: auth
- func: "fetch_c_driver_source"
- func: "compile"
- func: "test auth"
- func: "test atlas connectivity"
- name: compile_and_test_with_static_libs
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
USE_STATIC_LIBS: 1
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
vars:
USE_STATIC_LIBS: 1
- name: compile_and_test_with_static_libs_extra_alignment
commands:
- func: "setup"
- func: "start_mongod"
- func: "fetch_c_driver_source"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "compile"
vars:
USE_STATIC_LIBS: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "test"
vars:
USE_STATIC_LIBS: 1
- name: compile_and_test_with_shared_libs_replica_set
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "replica_set"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
- name: compile_and_test_with_shared_libs_sharded_cluster
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "sharded_cluster"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
# Auto downloading the C driver in the C++ build does not currently include
# support for libmongocrypt, therefore it is not configured with
# -DENABLE_CLIENT_SIDE_ENCRYPTION=ON. For now, CSFLE tests will need to have
# a manually configured C driver, hence the need to seperate this task.
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "replica_set"
- func: "install_c_driver"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "test"
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "sharded_cluster"
- func: "install_c_driver"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "test"
- name: uninstall_check
commands:
- func: "setup"
- func: "fetch_c_driver_source"
- func: "compile"
- command: expansions.update
params:
updates:
- key: mongocxx_version_finder_sh
value: $(sed -nE 's/^#define MONGOCXX_VERSION_STRING "([^"]+)".*/\1/p' build/src/mongocxx/config/version.hpp)
- command: shell.exec
type: test
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |-
set -o errexit
export INSTALL_VERSION=${mongocxx_version_finder_sh}
sh ./.evergreen/uninstall_check.sh
- name: uninstall_check_windows
commands:
- func: "setup"
- func: "fetch_c_driver_source"
- func: "compile"
- command: expansions.update
params:
updates:
- key: mongocxx_version_finder_sh
value: $(sed -nE 's/^#define MONGOCXX_VERSION_STRING "([^"]+)".*/\1/p' build/src/mongocxx/config/version.hpp)
- command: shell.exec
type: test
params:
shell: bash
working_dir: "mongo-cxx-driver"
script: |-
set -o errexit
export INSTALL_VERSION=${mongocxx_version_finder_sh}
cmd.exe /c .\\.evergreen\\uninstall_check_windows.cmd
- name: build_example_with_add_subdirectory
commands:
- func: "setup"
- func: "start_mongod"
- command: shell.exec
type: test
params:
working_dir: "mongo-cxx-driver"
shell: bash
script: |-
set -o errexit
cd examples/add_subdirectory
[ -d mongo-c-driver ] || git clone --depth 1 https://github.com/mongodb/mongo-c-driver
rsync -aq --exclude='examples/add_subdirectory' $(readlink -f ../..) .
[ -d build ] || mkdir build
. ./mongo-c-driver/.evergreen/scripts/find-cmake-latest.sh
export CMAKE
CMAKE="$(find_cmake_latest)"
command -v "$CMAKE"
$CMAKE -S . -B build -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
$CMAKE --build build
./build/hello_mongocxx
- name: debian-package-build
run_on: ubuntu1804-test
commands:
- func: "setup"
- command: shell.exec
type: test
params:
working_dir: "mongo-cxx-driver"
shell: bash
script: |-
set -o errexit
export IS_PATCH="${is_patch}"
sh .evergreen/debian_package_build.sh
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: deb.tar.gz
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/debian-packages.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "deb.tar.gz"
- name: debian-package-build-mnmlstc
run_on: ubuntu1804-test
commands:
- func: "setup"
- command: shell.exec
type: test
params:
working_dir: "mongo-cxx-driver"
shell: bash
script: |-
set -o errexit
export IS_PATCH="${is_patch}"
export DEB_BUILD_PROFILES="pkg.mongo-cxx-driver.mnmlstc"
sh .evergreen/debian_package_build.sh
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: deb.tar.gz
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/debian-packages-mnmlstc.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "deb.tar.gz"
- name: rpm-package-build
run_on: rhel90-arm64-small
commands:
- func: "setup"
- command: shell.exec
type: test
params:
working_dir: "mongo-cxx-driver"
shell: bash
script: |-
set -o errexit
sh .evergreen/build_snapshot_rpm.sh
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/rpm-packages.tar.gz
bucket: mciuploads
permissions: public-read
local_file: rpm.tar.gz
content_type: ${content_type|application/x-gzip}
- name: test_mongohouse
commands:
- func: "setup"
- func: "fetch_c_driver_source"
- func: "compile"
- func: "build_mongohouse"
- func: "run_mongohouse"
- func: "test_mongohouse"
- name: test_versioned_api
commands:
- func: "setup"
- func: "start_mongod"
vars:
REQUIRE_API_VERSION: true
# Authentication with versioned API should already be tested
# in the C driver.
AUTH: noauth
- func: "fetch_c_driver_source"
- func: "compile"
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "test"
vars:
MONGODB_API_VERSION: 1
- name: test_versioned_api_accept_version_two
commands:
- func: "setup"
- func: "start_mongod"
vars:
ORCHESTRATION_FILE: versioned-api-testing.json
AUTH: noauth
- func: "fetch_c_driver_source"
- func: "compile"
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "test"
- name: docker_build_arm
run_on:
- ubuntu2204-arm64-small
commands:
- func: "setup"
- func: "docker-image-build"
- name: docker_build
run_on:
- ubuntu2204-small
commands:
- func: "setup"
- func: "docker-image-build"
- name: test_search_index_helpers
commands:
- func: "install_c_driver"
- func: "compile"
- command: shell.exec
params:
shell: bash
working_dir: mongo-cxx-driver
script: |
export MONGODB_URI=${MONGODB_URI}
if [ -n "${lib_dir}" ]; then
export LD_LIBRARY_PATH=$(pwd)/../mongoc/${lib_dir}/
else
export LD_LIBRARY_PATH=$(pwd)/../mongoc/lib/
fi
./build/src/mongocxx/test/test_driver "atlas search indexes prose tests"
task_groups:
- name: test_atlas_task_group_search_indexes
setup_group:
- func: "setup"
- func: "clone_drivers-evergreen-tools"
- command: subprocess.exec
params:
working_dir: mongo-cxx-driver
binary: bash
add_expansions_to_env: true
env:
MONGODB_VERSION: '7.0'
args:
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
- command: expansions.update
# Expected to set MONGODB_URI expansion.
params:
file: mongo-cxx-driver/atlas-expansion.yml
teardown_group:
- command: subprocess.exec
params:
working_dir: mongo-cxx-driver
binary: bash
add_expansions_to_env: true
args:
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800
tasks:
- test_search_index_helpers
#######################################
# Buildvariants #
#######################################
buildvariants:
#######################################
# Standard MongoDB Integration Tests #
#######################################
- name: integration-ubuntu2004-latest-single
display_name: "Ubuntu 20.04 Debug (MongoDB Latest)"
run_on: ubuntu2004-large
expansions:
mongodb_version: "latest"
<<: *integration_matrix_expansions_linux
<<: *integration_matrix_tasks_single
- name: integration-ubuntu2004-7.0-single
display_name: "Ubuntu 20.04 Debug (MongoDB 7.0)"
run_on: ubuntu2004-large
expansions:
mongodb_version: "7.0"
<<: *integration_matrix_expansions_linux
<<: *integration_matrix_tasks_single