summaryrefslogtreecommitdiff
path: root/etc/drivers_nightly.yml
blob: c7c97c6d698498f3a4d68c4579b636cc244ad819 (plain)
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
#####################################################
#               Drivers Nightly Tests               #
#####################################################

### Instructions for Adding a Driver ###
# The Major sections are:

# VARIABLES
# FUNCTIONS (MongoDB and Drivers)
# TASKS (MongoDB and Drivers)
# AXES (Drivers)
# MODULES (MongoDB and Drivers)
# BUILDVARIANTS (MongoDB and Drivers)

# The Major sections of this config file have a space that handles the Mongodb setup, compile and test.
# And a section that handles the same for drivers after MongoDB and compiled, tested, and pushed.

# To Add a Driver:

# Add your repo to the MODULES section
# Add your Driver-specific AXES and variables
# Add your Driver-specific Matrix at the bottom of this file
# Update the Driver-specific variables in the 'run driver tests' function if needed
#
### Instructions for updating for future branches
# 1. File a BUILD ticket to add permissions to the project's AWS keys so they
# can write to the mciuploads bucket, at the root folder that has the same
# name as the drivers-nightly project for the branch you are adding.
# ex: drivers-nightly-4.4
#
# 2. Make a git branch off a known good commit, where compile and unittests are
# green
#
# 2. Synchronize this file with etc/evergreen.yml
#    - venv and pip setup (&setup_venv)
#    - compile
#      - Make sure the compile_flags and extra_flags are synchronized, and that
#      you are performing a release build
#    - "run mongo tests"
#
# 3. Run patch builds, ensuring that issues with compile are resolved
#    - Inspect the drivers tests failures, and make sure that the errors are
#    caused by drivers tests, and not by setup or s3 failures
#
# 4. Update this block with any pain points for the next person here

stepback: true
command_type: system

# Files that match an ignore-list pattern will not trigger a build, if they're the only modified
# files in the patch.
ignore:
  - ".*"
  - "!.clang-format"
  - "!.eslintrc.yml"
  - "*.md"
  - "*.rst"
  - "*.txt"
  - "/distsrc/**"
  - "/docs/**"
  - "/etc/*.yml"
  - "!/etc/drivers_nightly.yml"
  - "README"

#######################################
#            VARIABLES                #
#######################################
variables:

# Used when the tests it runs depend only on mongod, mongos, the mongo shell and the tools.
- &task_template
  name: template
  depends_on:
  - name: compile
  commands:
  - func: "do setup"
  - func: "run mongo 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.

# Used to list modules to retrieve from GitHub and apply patches if necessary.
- &git_get_project
  command: git.get_project
  params:
    directory: src
    revisions: # for each module include revision as <module_name>: ${<module_name>_rev}
      enterprise: ${enterprise_rev}
      mongo-java-driver: ${mongo-java-driver_rev}
      mongo-python-driver: ${mongo-python-driver_rev}
      drivers-evergreen-tools: ${drivers-evergreen-tools_rev}

- &generate_compile_expansions
  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

      ${activate_venv}

      # This script converts the generated version string into a sanitized version string for
      # use by scons and uploading artifacts as well as information about for the scons cache.
      MONGO_VERSION=$MONGO_VERSION                    \
        SCONS_CACHE_MODE=${scons_cache_mode|nolinked} \
        USE_SCONS_CACHE=${use_scons_cache|false}      \
          $python buildscripts/generate_compile_expansions.py --out compile_expansions.yml

- &apply_compile_expansions
  command: expansions.update
  params:
    file: src/compile_expansions.yml

#######################################
#            FUNCTIONS                #
#######################################

### MONGODB COMPILE & TEST FUNCTIONS ###

functions:
  "set task expansion macros": &set_task_expansion_macros
    command: expansions.update
    params:
      updates:
      - key: activate_venv
        value: |
          # check if virtualenv is set up
          if [ -d "${workdir}/venv" ]; then
            if [ "Windows_NT" = "$OS" ]; then
              # Need to quote the path on Windows to preserve the separator.
              . "${workdir}/venv/Scripts/activate" 2> /tmp/activate_error.log
            else
              . ${workdir}/venv/bin/activate 2> /tmp/activate_error.log
            fi
            if [ $? -ne 0 ]; then
              echo "Failed to activate venv: $(cat /tmp/activate_error.log)"
            fi
            python=python
          else
            python=${python|/opt/mongodbtoolchain/v3/bin/python3}
          fi

          if [ "Windows_NT" = "$OS" ]; then
            export PYTHONPATH="$PYTHONPATH;$(cygpath -w ${workdir}/src)"
          else
            export PYTHONPATH="$PYTHONPATH:${workdir}/src"
          fi

          echo "python set to $(which $python)"

  "fetch binaries": &fetch_binaries
    command: s3.get
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      remote_file: drivers-nightly/${platform}/${revision}/binaries/mongo-${revision}.${ext|tgz}
      bucket: mciuploads
      local_file: src/mongodb-binaries.${ext|tgz}

  "extract binaries": &extract_binaries
    command: shell.exec
    params:
      working_dir: src
      script: |
        set -o errexit
        set -o verbose

        ${decompress|tar xzvf} mongodb-binaries.${ext|tgz}
        chmod +x mongodb*/bin/*
        mv mongodb*/bin/* .

  "get buildnumber": &get_buildnumber
    command: keyval.inc
    params:
      key: "v4.4"
      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

  "do setup":
  - *git_get_project
  - *setup_venv
  - *fetch_binaries
  - *extract_binaries
  - *get_buildnumber
  - *setup_credentials


  ### FOR MONGODB TESTS ###
  "set up venv": &setup_venv
    command: shell.exec
    type: test
    params:
        working_dir: src
        script: |
          # exit immediately if virtualenv is not found
          set -o errexit

          python_loc=$(which ${python|/opt/mongodbtoolchain/v3/bin/python3})
          venv_dir="${workdir}/venv"
          "$python_loc" -m venv --system-site-packages "$venv_dir"

          # venv creates its Scripts/activate file with CLRF endings, which
          # cygwin bash does not like. dos2unix it
          # (See https://bugs.python.org/issue32451)
          if [ "Windows_NT" = "$OS" ]; then
            dos2unix "${workdir}/venv/Scripts/activate"
          fi

          export VIRTUAL_ENV_DISABLE_PROMPT=yes

          # Not all git get project calls clone into ${workdir}/src so we allow
          # callers to tell us where the pip requirements files are.
          pip_dir="${pip_dir}"
          if [[ -z $pip_dir ]]; then
            # Default to most common location
            pip_dir="${workdir}/src/etc/pip"
          fi

          # Same as above we have to use quotes to preserve the
          # Windows path separator
          toolchain_txt="$pip_dir/toolchain-requirements.txt"
          ${activate_venv}
          python -m pip install -r "$toolchain_txt" -q
          python -m pip freeze > pip-requirements.txt

  "run mongo tests":
    command: shell.exec
    type: test
    params:
      working_dir: src
      script: |
        set -o errexit
        set -o verbose

        ${activate_venv}

        extra_args=""
        processor_architecture=$(uname -m)
        num_jobs_available=${num_jobs_available|1}

        if [ ${max_jobs|0} -gt 0 ] && [ ${max_jobs|0} -lt $num_jobs_available ]; then
          extra_args="$extra_args --jobs=${max_jobs}"
        else
          extra_args="$extra_args --jobs=$num_jobs_available"
        fi

        $python buildscripts/resmoke.py run ${resmoke_args} $extra_args ${test_flags} --log=buildlogger --reportFile=report.json

  "cleanup environment":
    command: shell.exec
    params:
      script: |
        set -o errexit
        set -o verbose

        rm -rf src /data/db/* mongo-diskstats* mongo-coredumps.tgz ~/.aws
        pkill -9 orchest

  ### DRIVERS FUNCTIONS ###

  "bootstrap mongo-orchestration":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config
          MONGODB_VERSION="nightly" MONGODB_DOWNLOAD_URL=${MONGODB_DOWNLOAD_URL} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
    # run-orchestration generates expansion file with the MONGODB_URI for the cluster
    - command: expansions.update
      params:
        file: mo-expansion.yml

  "run driver tests":
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          cd ${DRIVER_WORKING_DIRECTORY}
          ${PREPARE_SHELL}
          echo $DRIVERS_TOOLS
          echo $MONGO_ORCHESTRATION_HOME
          echo $MONGODB_BINARIES
          echo $UPLOAD_BUCKET
          echo $PROJECT_DIRECTORY

          echo $TMPDIR
          echo $PATH
          echo $PROJECT

          # If there are extra dependencies, we set them up here first
          file="${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
          # Don't use ${file} syntax here because evergreen treats it as an empty expansion.
          [ -f "$file" ] && sh $file || echo "$file not available, skipping"

          ### DRIVER-SPECIFIC VARIABLES HERE
          PYTHON_BINARY="${PYTHON_BINARY}" \
          JDK="${JDK}" \
          SAFE_FOR_MULTI_MONGOS="true" \
          AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" .evergreen/run-tests.sh

  "fix absolute paths":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do
            perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename
          done

  "windows fix":
    - command: shell.exec
      params:
        script: |
          # Make sure we are on Windows, otherwise don't run
          if [ "Windows_NT" == "$OS" ]; then # Magic variable in cygwin
            ${PREPARE_SHELL}
            for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
              cat $i | tr -d '\r' > $i.new
              mv $i.new $i
            done
            # Copy client certificate because symlinks do not work on Windows.
            cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
          fi

  "make files executable":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
            chmod +x $i
          done

  "init test-results":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          echo '{"results": [{ "status": "FAIL", "test_file": "Build", "log_raw": "No test-results.json found was created"  } ]}' > ${PROJECT_DIRECTORY}/test-results.json

  "upload xml test results":
    - command: attach.xunit_results
      params:
        file: "${DRIVER_TEST_UPLOAD_DIRECTORY}"


   ### UPLOAD MONGODB AND ORCHESTRATION LOGS ###
  "upload mo artifacts":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          find $MONGO_ORCHESTRATION_HOME -name \*.log | xargs tar czf ${PROJECT_DIRECTORY}/mongodb-logs.tar.gz
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${PROJECT_DIRECTORY}/mongodb-logs.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${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"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${DRIVERS_TOOLS}/.evergreen/orchestration/server.log
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-orchestration.log
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|text/plain}
        display_name: "orchestration.log"

  "setup drivers environment":
    - *set_task_expansion_macros
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
           cd ${DRIVER_WORKING_DIRECTORY}
           # Get the current unique version of this checkout
           if [ "${is_patch}" = "true" ]; then
              CURRENT_VERSION=$(git describe)-patch-${version_id}
           else
              CURRENT_VERSION=latest
           fi

           export DRIVERS_TOOLS="$(pwd)/../drivers-evergreen-tools"

           # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
           if [ "Windows_NT" == "$OS" ]; then # Magic variable in cygwin
              export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
           fi

           echo "TESTING PLATFORM ${PLATFORM}"

           export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
           export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
           export UPLOAD_BUCKET="${project}"
           export PROJECT_DIRECTORY="$(pwd)"
           export MONGODB_DOWNLOAD_URL="https://s3.amazonaws.com/mciuploads/drivers-nightly/${PLATFORM}/${revision}/binaries/mongo-${revision}.${FILE_EXT}"

           cat <<EOT > expansion.yml
           CURRENT_VERSION: "$CURRENT_VERSION"
           DRIVERS_TOOLS: "$DRIVERS_TOOLS"
           MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
           MONGODB_BINARIES: "$MONGODB_BINARIES"
           UPLOAD_BUCKET: "$UPLOAD_BUCKET"
           PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
           MONGODB_DOWNLOAD_URL: "$MONGODB_DOWNLOAD_URL"
           PREPARE_SHELL: |
              set -o errexit
              set -o xtrace
              export DRIVERS_TOOLS="$DRIVERS_TOOLS"
              export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
              export MONGODB_BINARIES="$MONGODB_BINARIES"
              export UPLOAD_BUCKET="$UPLOAD_BUCKET"
              export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
              export MONGODB_DOWNLOAD_URL="$MONGODB_DOWNLOAD_URL"

              export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
              export PATH="$MONGODB_BINARIES:$PATH"
              export PROJECT="${project}"
           EOT
           # See what we've done
           cat expansion.yml

    # Load the expansion file to make an evergreen variable with the current unique version
    - command: expansions.update
      params:
        file: src/${DRIVER_WORKING_DIRECTORY}/expansion.yml

### PRE ###
pre:
  - func: "cleanup environment"

### POST ###
post:
  - command: attach.results
    params:
      file_location: src/report.json
  - func: "upload mo artifacts"
  - func: "upload xml test results"
  # Cleanup steps.
  - 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.
        ${activate_venv}

        if [ -d "${scons_cache_path}" ]; then
            $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
  - func: "cleanup environment"

#######################################
#               TASKS                 #
#######################################

tasks:

### MONGO COMPILE & TEST TASKS ###

- name: compile
  depends_on: []
  commands:
    - *set_task_expansion_macros
    - command: manifest.load
    - *git_get_project
    - *setup_venv
    - func: "get buildnumber"
    - func: "setup credentials"
    - *generate_compile_expansions
    # Then we load the generated version data into the agent so we can use it in task definitions
    - *apply_compile_expansions

    - command: shell.exec
      type: test
      params:
        working_dir: src
        script: |
          set -o errexit
          set -o verbose

          # extra_args from etc/evergreen.yml
          # Only allow hygienic builds in Evergreen, and use hardlinks to
          # reduce the disk space impact of installing all of the binaries and
          # associated debug info.

          # By default, limit link jobs to one quarter of our overall -j
          # concurrency unless locally overridden. We do this because in
          # static link environments, the memory consumption of each
          # link job is so high that without constraining the number of
          # links we are likely to OOM or thrash the machine. Dynamic
          # builds, where htis is not a concern, override this value.
          echo "Changing SCons to run with --jlink=${num_scons_link_jobs_available|0.25}"
          extra_args="$extra_args --jlink=${num_scons_link_jobs_available|0.25}"

          if [ "${scons_cache_scope|}" = "shared" ]; then
            extra_args="$extra_args --cache-debug=scons_cache.log"
          fi

          # Enable performance debugging
          extra_args="$extra_args --debug=time"

          # Build packages where the upload tasks expect them
          extra_args="$extra_args PKGDIR=${workdir}/src"
          extra_args="$extra_args --release --detect-odr-violations --separate-debug"

          rm -rf ${install_directory|/data/mongo-install-directory}

          ${activate_venv}

          ${compile_env|} $python ./buildscripts/scons.py                                     \
              ${compile_flags|} ${scons_cache_args|} $extra_args                              \
              archive-dist-test install-unittests install-unittests-debug                     \
              MONGO_VERSION=${version}

          # Note to next reader: mongo drivers tests expect the binaries to be
          # packed differently than archive-dist-test. Don't try and use
          # it for this purpose
          # Pack up the binaries
          mkdir -p mongodb-binaries/bin
          find build/install/bin -maxdepth 1 -type f -iname "mongo*" ! \( -iname "*_*" -o -iname ".debug" \) -exec mv {} ./mongodb-binaries/bin/ \;
          ${compress} mongodb-binaries.${ext|tgz} mongodb-binaries/

    ### Run the unittests after the compile
    - func: "run mongo tests"
      vars:
        resmoke_args: --suites=unittests
        run_multiple_jobs: true

    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: src/mongodb-binaries.${ext|tgz}
        remote_file: drivers-nightly/${platform}/${revision}/binaries/mongo-${revision}.${ext|tgz}
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: Binaries

- <<: *task_template
  name: jsCore_WT
  commands:
  - *set_task_expansion_macros
  - func: "do setup"
  - func: "run mongo tests"
    vars:
      resmoke_args: --suites=core --storageEngine=wiredTiger
      run_multiple_jobs: true

### DRIVER TEST TASKS ###
- name: "test-nightly-standalone"
  depends_on:
   - variant: ".compile-variant"
     name: "jsCore_WT"
  tags: ["nightly", "standalone"]
  commands:
    - *git_get_project
    - func: "setup drivers environment"
      vars:
        VERSION: "nightly"
        TOPOLOGY: "server"
    - func: "windows fix"
    - func: "fix absolute paths"
    - func: "init test-results"
    - func: "make files executable"
    - func: "bootstrap mongo-orchestration"
    - func: "run driver tests"

- name: "test-nightly-replica_set"
  depends_on:
    - variant: ".compile-variant"
      name: "jsCore_WT"
  tags: ["nightly", "replica_set"]
  commands:
    - *git_get_project
    - func: "setup drivers environment"
      vars:
        VERSION: "nightly"
        TOPOLOGY: "replica_set"
    - func: "windows fix"
    - func: "fix absolute paths"
    - func: "init test-results"
    - func: "make files executable"
    - func: "bootstrap mongo-orchestration"
    - func: "run driver tests"

- name: "test-nightly-sharded_cluster"
  depends_on:
    - variant: ".compile-variant"
      name: "jsCore_WT"
  tags: ["nightly", "sharded_cluster"]
  commands:
    - *git_get_project
    - func: "setup drivers environment"
      vars:
        VERSION: "nightly"
        TOPOLOGY: "sharded_cluster"
    - func: "windows fix"
    - func: "fix absolute paths"
    - func: "init test-results"
    - func: "make files executable"
    - func: "bootstrap mongo-orchestration"
    - func: "run driver tests"

#######################################
#                AXES                 #
#######################################
axes:
  ### GENERAL FOR ALL DRIVERS TESTS ###
  - id: os
    display_name: OS
    values:
      - id: "rhel70"
        display_name: "RHEL 7.0"
        run_on: rhel70-small
        variables:
          PLATFORM: "linux"
          FILE_EXT: "tgz"
      - id: "windows64"
        display_name: "Windows 64"
        run_on: windows-64-vs2019-small
        variables:
          PLATFORM: "windows64"
          FILE_EXT: "zip"
  - id: auth
    display_name: Authentication
    values:
      - id: "auth"
        display_name: Auth
        variables:
           AUTH: "auth"

  - id: ssl
    display_name: SSL
    values:
      - id: "ssl"
        display_name: SSL
        variables:
           SSL: "ssl"

  ### DRIVER-SPECIFIC AXES ###
  ### DRIVERS TEAM, ADD YOUR AXES VARIABLES HERE ###

  ### Java ###
  - id: jdk
    display_name: JDK
    values:
      - id: "jdk8"
        display_name: JDK8
        variables:
           JDK: "jdk8"
           DRIVER_WORKING_DIRECTORY: "mongo-java-driver"
           DRIVER_TEST_UPLOAD_DIRECTORY: "src/mongo-java-driver/*/build/test-results/*/TEST-*.xml"
  ### Python ###
  - id: python-linux
    display_name: "Python"
    values:
      - id: "3.6"
        display_name: "Python 3.6"
        variables:
           PYTHON_BINARY: "/opt/mongodbtoolchain/v2/bin/python3"
           DRIVER_WORKING_DIRECTORY: "mongo-python-driver"
           DRIVER_TEST_UPLOAD_DIRECTORY: "src/mongo-python-driver/xunit-results/TEST-*.xml"
  - id: python-windows
    display_name: "Windows Visual Studio 2010 Python"
    values:
      - id: "3.6"
        display_name: "Python 3.6"
        variables:
           PYTHON_BINARY: "/cygdrive/c/python/Python36/python.exe"
           DRIVER_WORKING_DIRECTORY: "mongo-python-driver"
           DRIVER_TEST_UPLOAD_DIRECTORY: "src/mongo-python-driver/xunit-results/TEST-*.xml"

#######################################
#               MODULES               #
#######################################

# If a module is added it must be added to the manifest
# be sure to add the module to 'git.get_project' revisions parameter
# DRIVERS add your own git repo / branch here and add up top in 'git.get_project'
modules:
- name: enterprise
  repo: git@github.com:10gen/mongo-enterprise-modules.git
  prefix: src/mongo/db/modules
  branch: v4.4

# Shared by all drivers projects
- name: drivers-evergreen-tools
  repo: git@github.com:mongodb-labs/drivers-evergreen-tools.git
  branch: master

### DRIVER REPOS ###
### DRIVERS ADD YOUR GIT REPO HERE ###
- name: mongo-java-driver
  repo: git@github.com:mongodb/mongo-java-driver.git
  branch: master

- name: mongo-python-driver
  repo: git@github.com:mongodb/mongo-python-driver.git
  branch: master

#######################################
#            BUILDVARIANTS            #
#######################################

buildvariants:

### MONGO COMPILE VARIANTS ###

### Linux Compile Variant ###
- name: rhel70
  display_name: RHEL 7.0 MongoDB Compile
  modules:
  - enterprise
  run_on:
  - rhel70-small
  expansions:
    platform: linux
    compile_flags: --ssl MONGO_DISTMOD=rhel70 -j$(grep -c ^processor /proc/cpuinfo) --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars
    multiversion_platform_arch: "rhel70"
    multiversion_edition: "targeted"
    num_jobs_available: $(grep -c ^processor /proc/cpuinfo)
    use_scons_cache: true
    ext: tgz
    compress: tar czf
  tags: ["compile-variant"]
  tasks:
  - name: compile
    distros:
    - rhel70-large
  - name: jsCore_WT

### Windows compile variant ###
- name: enterprise-windows-64
  display_name: "Enterprise Windows MongoDB Compile"
  modules:
  - enterprise
  run_on:
  - windows-64-vs2019-small
  expansions:
    platform: "windows64"
    exe: ".exe"
    content_type: application/zip
    compile_flags: --ssl MONGO_DISTMOD=windows CPPPATH="c:/sasl/include c:/snmp/include" LIBPATH="c:/sasl/lib c:/snmp/lib" -j$(( $(grep -c ^processor /proc/cpuinfo) / 2 )) --win-version-min=win10
    num_jobs_available: $(grep -c ^processor /proc/cpuinfo)
    ext: zip
    use_scons_cache: true
    python: '/cygdrive/c/python/Python37/python.exe'
    compress: 7z a
  tags: ["compile-variant"]
  tasks:
  - name: compile
    distros:
    - windows-64-vs2019-large
  - name: jsCore_WT

### DRIVER Test Variants
### DRIVERS add your matrix or test variant here

### Python Matrix Linux
- matrix_name: "python-driver-linux"
  matrix_spec: {auth: "*", ssl: "*", os: "rhel70", python-linux: "3.6"}
  display_name: "Python Driver ${os} ${python-linux} ${auth} ${ssl}"
  modules: ["mongo-python-driver", "drivers-evergreen-tools"]
  tasks:
     - name: "test-nightly-replica_set"
     - name: "test-nightly-sharded_cluster"
     - name: "test-nightly-standalone"

### Python Matrix Windows
- matrix_name: "python-driver-windows"
  matrix_spec: {auth: "*", ssl: "*", os: "windows64", python-windows: "3.6"}
  display_name: "Python Driver ${os} ${python-windows} ${auth} ${ssl}"
  modules: ["mongo-python-driver", "drivers-evergreen-tools"]
  tasks:
     - name: "test-nightly-replica_set"
     - name: "test-nightly-sharded_cluster"
     - name: "test-nightly-standalone"

### Java Matrix Linux
- matrix_name: "java-driver-linux"
  matrix_spec: {auth: "*", ssl: "*", os: "rhel70", jdk: "jdk8"}
  display_name: "Java Driver ${os} ${jdk} ${auth} ${ssl}"
  modules: ["mongo-java-driver", "drivers-evergreen-tools"]
  tasks:
     - name: "test-nightly-replica_set"
     - name: "test-nightly-sharded_cluster"
     - name: "test-nightly-standalone"