########################################
# Evergreen Template for MongoDB Drivers
# Modified for the PHP driver
########################################

# When a task that used to pass starts to fail
# Go through all versions that may have been skipped to detect
# when the task started failing
stepback: true

# Mark a failure as a system/bootstrap failure (purple box) rather then a task
# failure by default.
# Actual testing tasks are marked with `type: test`
command_type: system

# Protect ourself against rogue test case, or curl gone wild, that runs forever
# Good rule of thumb: the averageish length a task takes, times 5
# That roughly accounts for variable system performance for various buildvariants
exec_timeout_secs: 1800 # 6 minutes is the longest we'll ever run

# What to do when evergreen hits the timeout (`post:` tasks are run automatically)
timeout:
  - command: shell.exec
    params:
      script: |
        ls -la

functions:
  "fetch source":
    # Executes git clone and applies the submitted patch, if any
    - command: git.get_project
      params:
        directory: "src"
    # Fetch the libmongoc submodule
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
           git submodule update --init
    # Switch to a different version of libmongoc
    - command: shell.exec
      params:
        working_dir: "src/src/libmongoc"
        script: |
           if [ -n "${LIBMONGOC_VERSION}" ]; then
              echo "Checking out libmongoc version: ${LIBMONGOC_VERSION}"
              git fetch
              git checkout ${LIBMONGOC_VERSION}
              # Note: compile-unix.sh will run `make libmongoc-version-current`
           fi
    # Applies the submitted patch, if any
    # Deprecated. Should be removed. But still needed for certain agents (ZAP)
    - command: git.apply_patch
    # Make an evergreen expansion file with dynamic values
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
           # 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-tools"
           export PROJECT_DIRECTORY="$(pwd)"

           # 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)
              export PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY)
           fi

           if [ -d "/opt/php/${PHP_VERSION}-64bit/bin" ]; then
              PHP_PATH="/opt/php/${PHP_VERSION}-64bit/bin"
           else
              # Try to find the newest version matching our constant
              PHP_PATH=`find /opt/php/ -maxdepth 1 -type d -name '${PHP_VERSION}*-64bit' -print | sort -V -r | head -1`/bin
           fi

           if [ ! -d "$PHP_PATH" ]; then
              echo "Could not find PHP binaries for version ${PHP_VERSION}. Listing available versions..."
              ls -1 /opt/php
              exit 1
           fi

           export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
           # Note: PHPC no longer has any custom MO configs, but they can be stored here if needed
           export PROJECT_ORCHESTRATION_HOME="$PROJECT_DIRECTORY/.evergreen/orchestration"
           export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
           export UPLOAD_BUCKET="${project}"
           export PHP_VERSION="${PHP_VERSION}"

           cat <<EOT > expansion.yml
           CURRENT_VERSION: "$CURRENT_VERSION"
           DRIVERS_TOOLS: "$DRIVERS_TOOLS"
           MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
           PROJECT_ORCHESTRATION_HOME: "$PROJECT_ORCHESTRATION_HOME"
           MONGODB_BINARIES: "$MONGODB_BINARIES"
           UPLOAD_BUCKET: "$UPLOAD_BUCKET"
           PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"

           PREPARE_SHELL: |
              set -o errexit
              export DRIVERS_TOOLS="$DRIVERS_TOOLS"
              export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
              export PROJECT_ORCHESTRATION_HOME="$PROJECT_ORCHESTRATION_HOME"
              export MONGODB_BINARIES="$MONGODB_BINARIES"
              export UPLOAD_BUCKET="$UPLOAD_BUCKET"
              export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"

              export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
              export PATH="$PHP_PATH:$MONGODB_BINARIES:$PATH"
              export PROJECT="${project}"

              export PHP_VERSION="$PHP_VERSION"
              export SSL_DIR="$DRIVERS_TOOLS/.evergreen/x509gen"
              export LIBMONGOC_VERSION="${LIBMONGOC_VERSION}"
           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/expansion.yml

  "prepare resources":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          rm -rf $DRIVERS_TOOLS
          if [ "${project}" = "drivers-tools" ]; then
            # If this was a patch build, doing a fresh clone would not actually test the patch
            cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS
          else
            git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
          fi
          echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config

  "upload release":
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${project}.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${project}-${CURRENT_VERSION}.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}

  # Upload build artifacts that other tasks may depend on
  # Note this URL needs to be totally unique, while predictable for the next task
  # so it can automatically download the artifacts
  "upload build":
    # Compress and upload the entire build directory
    - command: archive.targz_pack
      params:
        # Example: mongo_c_driver_releng_9dfb7d741efbca16faa7859b9349d7a942273e43_16_11_08_19_29_52.tar.gz
        target: "${build_id}.tar.gz"
        source_dir: ${PROJECT_DIRECTORY}/
        include:
          - "./**"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${build_id}.tar.gz
        # Example: /mciuploads/${UPLOAD_BUCKET}/gcc49/9dfb7d741efbca16faa7859b9349d7a942273e43/debug-compile-nosasl-nossl/mongo_c_driver_releng_9dfb7d741efbca16faa7859b9349d7a942273e43_16_11_08_19_29_52.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${task_name}/${build_id}.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}

  "fetch build":
    - command: shell.exec
      params:
        continue_on_err: true
        script: "rm -rf ${PROJECT_DIRECTORY}"
    - command: s3.get
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${BUILD_NAME}/${build_id}.tar.gz
        bucket: mciuploads
        local_file: build.tar.gz
    - command: shell.exec
      params:
        continue_on_err: true
        # EVG-1105: Use s3.get extract_to: ./
        script: "cd .. && rm -rf ${PROJECT_DIRECTORY} && mkdir ${PROJECT_DIRECTORY}/ && tar xf build.tar.gz -C ${PROJECT_DIRECTORY}/"

  "exec compile script" :
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          [ -f ${PROJECT_DIRECTORY}/${file} ] && BUILDTOOL="${buildtool}" sh ${PROJECT_DIRECTORY}/${file} || echo "${PROJECT_DIRECTORY}/${file} not available, skipping"

  "compile driver" :
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          sh ${PROJECT_DIRECTORY}/.evergreen/compile-unix.sh

  "exec script" :
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          [ -f ${PROJECT_DIRECTORY}/${file} ] && sh ${PROJECT_DIRECTORY}/${file} || echo "${PROJECT_DIRECTORY}/${file} not available, skipping"

  "upload coverage" :
    - command: shell.exec
      params:
        silent: true
        script: |
           export AWS_ACCESS_KEY_ID=${aws_key}
           export AWS_SECRET_ACCESS_KEY=${aws_secret}
           aws s3 cp ${PROJECT_DIRECTORY}/coverage s3://mciuploads/${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/coverage/ --recursive --acl public-read --region us-east-1
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file:  ${PROJECT_DIRECTORY}/coverage/index.html
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/coverage/index.html
        bucket: mciuploads
        permissions: public-read
        content_type: text/html
        display_name: "Coverage Report"

  "upload scan artifacts" :
    - command: shell.exec
      type: test
      params:
        script: |
          cd
          if find ${PROJECT_DIRECTORY}/scan -name \*.html | grep -q html; then
            (cd ${PROJECT_DIRECTORY}/scan && find . -name index.html -exec echo "<li><a href='{}'>{}</a></li>" \;) >> scan.html
          else
            echo "No issues found" > scan.html
          fi
    - command: shell.exec
      params:
        silent: true
        script: |
           export AWS_ACCESS_KEY_ID=${aws_key}
           export AWS_SECRET_ACCESS_KEY=${aws_secret}
           aws s3 cp ${PROJECT_DIRECTORY}/scan s3://mciuploads/${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/scan/ --recursive --acl public-read --region us-east-1
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file:  ${PROJECT_DIRECTORY}/scan.html
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/scan/index.html
        bucket: mciuploads
        permissions: public-read
        content_type: text/html
        display_name: "Scan Build Report"

  "upload mo artifacts":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          find $MONGO_ORCHESTRATION_HOME -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: ${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"
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          find /tmp/MO -name \*.log | xargs tar czf mongodb-start-logs.tar.gz
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: mongodb-start-logs.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-start-logs.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: "mongodb-start-logs.tar.gz"

  "upload working dir":
    - command: archive.targz_pack
      params:
        target: "working-dir.tar.gz"
        source_dir: ${PROJECT_DIRECTORY}/
        include:
          - "./**"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: working-dir.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${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"
    - command: archive.targz_pack
      params:
        target: "drivers-dir.tar.gz"
        source_dir: ${DRIVERS_TOOLS}
        include:
          - "./**"
        exclude_files:
          # Windows cannot read the mongod *.lock files because they are locked.
          - "*.lock"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: drivers-dir.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-drivers-dir.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: "drivers-dir.tar.gz"

  "upload test results":
    - command: attach.xunit_results
      params:
        # Uploading test results does not work when using ${PROJECT_DIRECTORY},
        # so we use an absolute path to work around this
        file: "src/test-results.xml"
    - command: attach.results
      params:
        file_location: "${DRIVERS_TOOLS}/results.json"

  "bootstrap mongo-orchestration":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          MONGODB_VERSION=${MONGODB_VERSION} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} LOAD_BALANCER=${LOAD_BALANCER} REQUIRE_API_VERSION=${REQUIRE_API_VERSION} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
    # run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH
    - command: expansions.update
      params:
        file: mo-expansion.yml

  "stop mongo-orchestration":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          sh ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh

  "run OCSP responder":
    - command: shell.exec
      params:
        shell: bash
        script: |
          ${PREPARE_SHELL}
          TEST_COLUMN=${TEST_COLUMN} \
          CERT_TYPE=${CERT_TYPE} \
          USE_DELEGATE=${USE_DELEGATE} \
          ${PROJECT_DIRECTORY}/.evergreen/run-ocsp-responder.sh

  "run tests":
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          API_VERSION=${API_VERSION} \
          CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
          MONGODB_URI="${MONGODB_URI}${APPEND_URI}" \
          SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} \
          SSL=${SSL} \
          SSL_DIR=${SSL_DIR} \
          TESTS=${TESTS} \
          sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

  "cleanup":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          rm -rf $DRIVERS_TOOLS || true

  "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: |
          ${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

  "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

  "install dependencies":
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          file="${DRIVERS_TOOLS}/.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"

  "decrypt atlas URI list":
    - command: shell.exec
      params:
        script: |
          openssl aes-256-cbc -S "${encrypted_uris_salt}" -K "${encrypted_uris_key}" -iv "${encrypted_uris_iv}" -in ${PROJECT_DIRECTORY}/.evergreen/atlas-uris.txt.enc -out ${PROJECT_DIRECTORY}/.evergreen/atlas-uris.txt -d

  "start load balancer":
    - command: shell.exec
      params:
        script: |
          MONGODB_URI="${MONGODB_URI}" ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh start
    - command: expansions.update
      params:
        file: lb-expansion.yml

  "stop load balancer":
    - command: shell.exec
      params:
        script: |
          # Only run if a load balancer was started
          if [ -n "${SINGLE_MONGOS_LB_URI}" ]; then
            ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop
          fi

pre:
  - func: "fetch source"
  - func: "prepare resources"
  - func: "windows fix"
  - func: "fix absolute paths"
  - func: "init test-results"
  - func: "make files executable"
  - func: "install dependencies"

post:
  - func: "upload working dir"
  - func: "upload mo artifacts"
  - func: "upload test results"
  - func: "stop load balancer"
  - func: "stop mongo-orchestration"
  - func: "cleanup"

tasks:


    # Wildcard task. Do you need to find out what tools are available and where?
    # Throw it here, and execute this task on all buildvariants
    - name: getdata
      commands:
        - command: shell.exec
          type: test
          params:
            script: |
               . ${DRIVERS_TOOLS}/.evergreen/download-mongodb.sh || true
               get_distro || true
               echo $DISTRO
               echo $MARCH
               echo $OS
               uname -a || true
               ls /etc/*release* || true
               cc --version || true
               gcc --version || true
               clang --version || true
               gcov --version || true
               lcov --version || true
               llvm-cov --version || true
               echo $PATH
               ls -la /usr/local/Cellar/llvm/*/bin/ || true
               ls -la /usr/local/Cellar/ || true
               scan-build --version || true
               genhtml --version || true
               valgrind --version || true


# Standard test tasks {{{

    - name: "test-standalone"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
        - func: "run tests"

    - name: "test-standalone-auth"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            AUTH: "auth"
        - func: "run tests"

    - name: "test-standalone-ssl"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            SSL: "yes"
        - func: "run tests"
          vars:
            SSL: "yes"

    - name: "test-replicaset"
      tags: ["replicaset"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_set"
        - func: "run tests"

    - name: "test-replicaset-auth"
      tags: ["replicaset"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_set"
            AUTH: "auth"
        - func: "run tests"

    - name: "test-sharded"
      tags: ["sharded"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "sharded_cluster"
        - func: "run tests"

    - name: "test-atlas"
      tags: ["atlas"]
      commands:
        - func: "compile driver"
        - func: "decrypt atlas URI list"
        - func: "run tests"
          vars:
            TESTS: "tests/atlas.phpt"

    - name: "test-skip_crypt_shared"
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_set"
        - func: "run tests"
          vars:
            SKIP_CRYPT_SHARED: "yes"

    - name: "test-loadBalanced"
      tags: ["loadbalanced"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "sharded_cluster"
            LOAD_BALANCER: "true"
            SSL: "yes"
        - func: "start load balancer"
        - func: "run tests"
          vars:
            # Note: loadBalanced=true should already be appended to SINGLE_MONGOS_LB_URI
            MONGODB_URI: "${SINGLE_MONGOS_LB_URI}"
            SSL: "yes"
        # Note: "stop load balancer" will be called from "post"

    - name: "test-requireApiVersion"
      tags: ["versioned_api"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            AUTH: "auth"
            REQUIRE_API_VERSION: "yes"
        - func: "run tests"
          vars:
            API_VERSION: "1"

    - name: "ocsp-test_1-rsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_1"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_1-ecdsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_1"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_1-rsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_1"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_1-ecdsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_1"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_2-rsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_2"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_2-ecdsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_2"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_2-rsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_2"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_2-ecdsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_2"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_3-rsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_3"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_3-ecdsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_3"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_3-rsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_3"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_3-ecdsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_3"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_4-rsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_4"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_4-ecdsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_4"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-test_4-rsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_4"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-test_4-ecdsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "TEST_4"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-soft_fail_test-rsa"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-soft_fail_test-ecdsa"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-success.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-malicious_server_test_1-rsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "MALICIOUS_SERVER_TEST_1"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-malicious_server_test_1-ecdsa-delegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "MALICIOUS_SERVER_TEST_1"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "on"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-malicious_server_test_1-rsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "MALICIOUS_SERVER_TEST_1"
            CERT_TYPE: "rsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-malicious_server_test_1-ecdsa-nodelegate"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "run OCSP responder"
          vars:
            TEST_COLUMN: "MALICIOUS_SERVER_TEST_1"
            CERT_TYPE: "ecdsa"
            USE_DELEGATE: "off"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"
    - name: "ocsp-malicious_server_test_2-rsa"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "rsa-basic-tls-ocsp-mustStaple-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/rsa/ca.pem"
    - name: "ocsp-malicious_server_test_2-ecdsa"
      tags: ["ocsp"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "server"
            ORCHESTRATION_FILE: "ecdsa-basic-tls-ocsp-mustStaple-disableStapling.json"
        - func: "run tests"
          vars:
            TESTS: "tests/ocsp-failure.phpt"
            APPEND_URI: "/?tls=true&tlsCAFile=${DRIVERS_TOOLS}/.evergreen/ocsp/ecdsa/ca.pem"

# }}}


axes:
  - id: mongodb-versions
    display_name: MongoDB Version
    values:
      - id: "latest"
        display_name: "MongoDB latest"
        variables:
           MONGODB_VERSION: "latest"
      - id: "rapid"
        display_name: "MongoDB rapid"
        variables:
           MONGODB_VERSION: "rapid"
      - id: "7.0"
        display_name: "MongoDB 7.0"
        variables:
          MONGODB_VERSION: "7.0"
      - id: "6.0"
        display_name: "MongoDB 6.0"
        variables:
           MONGODB_VERSION: "6.0"
      - id: "5.0"
        display_name: "MongoDB 5.0"
        variables:
           MONGODB_VERSION: "5.0"
      - id: "4.4"
        display_name: "MongoDB 4.4"
        variables:
           MONGODB_VERSION: "4.4"
      - id: "4.2"
        display_name: "MongoDB 4.2"
        variables:
           MONGODB_VERSION: "4.2"
      - id: "4.0"
        display_name: "MongoDB 4.0"
        variables:
           MONGODB_VERSION: "4.0"
      - id: "3.6"
        display_name: "MongoDB 3.6"
        variables:
           MONGODB_VERSION: "3.6"

  - id: mongodb-edge-versions
    display_name: MongoDB Version
    values:
      - id: "latest-stable"
        display_name: "MongoDB 6.0"
        variables:
          MONGODB_VERSION: "6.0"
      - id: "oldest-supported"
        display_name: "MongoDB 3.6"
        variables:
          MONGODB_VERSION: "3.6"

  - id: php-versions
    display_name: PHP Version
    values:
      - id: "8.2"
        display_name: "PHP 8.2"
        variables:
          PHP_VERSION: "8.2"
      - id: "8.1"
        display_name: "PHP 8.1"
        variables:
          PHP_VERSION: "8.1"
      - id: "8.0"
        display_name: "PHP 8.0"
        variables:
          PHP_VERSION: "8.0"
      - id: "7.4"
        display_name: "PHP 7.4"
        variables:
          PHP_VERSION: "7.4"
      - id: "7.3"
        display_name: "PHP 7.3"
        variables:
          PHP_VERSION: "7.3"
      - id: "7.2"
        display_name: "PHP 7.2"
        variables:
          PHP_VERSION: "7.2"

  - id: php-edge-versions
    display_name: PHP Version
    values:
      - id: "latest-stable"
        display_name: "PHP 8.2"
        variables:
          PHP_VERSION: "8.2"
      - id: "oldest-supported"
        display_name: "PHP 7.2"
        variables:
          PHP_VERSION: "7.2"

  - id: os
    display_name: OS
    values:
      - id: debian11
        display_name: "Debian 11"
        run_on: debian11
      - id: debian10
        display_name: "Debian 10"
        run_on: debian10
      - id: debian92
        display_name: "Debian 9.2"
        run_on: debian92
      - id: rhel70
        display_name: "RHEL 7.0"
        run_on: rhel70
      - id: rhel71-power8
        display_name: "RHEL 7.1 Power 8"
        run_on: rhel71-power8-build
      - id: rhel72-zseries
        display_name: "RHEL 7.2 zSeries"
        run_on: rhel72-zseries-build
      - id: ubuntu1804-arm64
        display_name: "Ubuntu 18.04 ARM64"
        run_on: ubuntu1804-arm64-test
      # Pending installation of PHP toolchain on macOS hosts (see: PHPC-869)
      # - id: macos-1014
      #   display_name: "Mac OS 10.14"
      #   run_on: macos-1014

  - id: storage-engine
    display_name: Storage
    values:
      - id: mmapv1
        display_name: MMAPv1
        variables:
           STORAGE_ENGINE: "mmapv1"
      - id: wiredtiger
        display_name: WiredTiger
        variables:
           STORAGE_ENGINE: "wiredtiger"
      - id: inmemory
        display_name: InMemory
        variables:
           STORAGE_ENGINE: "inmemory"

  - id: libmongoc-version
    display_name: libmongoc version
    values:
      - id: "lowest-supported"
        display_name: "1.24.3"
        variables:
          LIBMONGOC_VERSION: "1.24.3"
      - id: "upcoming-stable"
        display_name: "1.24-dev"
        variables:
          LIBMONGOC_VERSION: "r1.24"
      - id: "latest-dev"
        display_name: "master"
        variables:
          LIBMONGOC_VERSION: "master"


buildvariants:
# Test all PHP versions with latest-stable MongoDB on Debian 11 and RHEL 7.0
- matrix_name: "test-php-versions"
  matrix_spec: { "os": ["rhel70", "debian11"], "mongodb-edge-versions": "latest-stable", "php-versions": "*" }
  display_name: "${os}, ${mongodb-edge-versions}, ${php-versions}"
  exclude_spec:
    # Exclude "latest-stable" PHP version for Debian 11 (see: test-mongodb-versions matrix)
    - { "os": "debian11", "mongodb-edge-versions": "*", "php-versions": "8.2" }
    # PHP 8.1+ is not available on rhel70
    - { "os": "rhel70", "mongodb-edge-versions": "*", "php-versions": ["8.1", "8.2"] }
  tasks:
    - name: "test-standalone-ssl"
    - name: "test-replicaset-auth"
    - name: "test-sharded"

# Test all topologies and MongoDB versions with latest-stable PHP version on Debian
- matrix_name: "test-mongodb-versions"
  matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable" }
  display_name: "${os}, ${mongodb-versions}, ${php-edge-versions}"
  exclude_spec:
    # Debian 9.2 only supports up to MongoDB 5.0
    - { "os": "debian92", "mongodb-versions": ["6.0", "7.0", "rapid", "latest"], "php-edge-versions": "latest-stable" }
    - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable" }
  tasks:
    - name: "test-standalone"
    - name: "test-standalone-auth"
    - name: "test-standalone-ssl"
    - name: "test-replicaset"
    - name: "test-replicaset-auth"
    - name: "test-sharded"

# Test ARM64, Power8, and zSeries architectures with MongoDB 4.4
- matrix_name: "test-alt-archs"
  matrix_spec: { "os": ["rhel71-power8", "rhel72-zseries", "ubuntu1804-arm64"], "mongodb-versions": "4.4", "php-edge-versions": "oldest-supported" }
  display_name: "${os}, ${mongodb-versions}, ${php-edge-versions}"
  tasks:
    - name: "test-standalone-ssl"
    - name: "test-replicaset-auth"
    - name: "test-sharded"

# Test alternative storage engines on MongoDB 4.0
- matrix_name: "test-storage-engines"
  matrix_spec: { "os": "debian92", "mongodb-versions": "4.0", "php-edge-versions": "latest-stable", "storage-engine": ["inmemory", "mmapv1"] }
  display_name: "${storage-engine}: ${os}, ${mongodb-edge-versions}, ${php-edge-versions}"
  tasks:
    - name: "test-standalone"

- matrix_name: "libmongoc-versions"
  matrix_spec: { "os": "debian11", "mongodb-edge-versions": "latest-stable", "php-edge-versions": "latest-stable", "libmongoc-version": "*" }
  display_name: "libmongoc ${libmongoc-version}: ${os}, ${mongodb-edge-versions}, ${php-edge-versions}"
  tasks:
    - name: "test-standalone-ssl"
    - name: "test-replicaset-auth"
    - name: "test-sharded"

- matrix_name: "atlas-connectivity-tests"
  matrix_spec: { "os": "debian11", "php-edge-versions": "latest-stable" }
  display_name: "Atlas Connectivity"
  tasks:
    - name: "test-atlas"

- matrix_name: "test-ocsp"
  matrix_spec: { "os": "debian10", "mongodb-versions": "*", "php-edge-versions": "latest-stable" }
  display_name: "OCSP tests - ${mongodb-versions}"
  exclude_spec:
    # OCSP is available from MongoDB 4.4+ (Debian 10 has MongoDB 4.4+)
    - { "os": "debian10", "mongodb-versions": ["3.6", "4.0", "4.2"], "php-edge-versions": "latest-stable" }
  tasks:
    - name: ".ocsp"

- matrix_name: "test-requireApiVersion"
  matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable" }
  display_name: "Versioned API - ${mongodb-versions}"
  exclude_spec:
    # Stable API is available from MongoDB 5.0+
    - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable" }
  tasks:
    - name: "test-requireApiVersion"

- matrix_name: "test-loadBalanced"
  matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable" }
  display_name: "Load balanced - ${mongodb-versions}"
  exclude_spec:
    # Load balancer is available from MongoDB 5.0+
    - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable" }
  tasks:
    - name: "test-loadBalanced"

- matrix_name: "test-csfle-skip_crypt_shared"
  matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable" }
  display_name: "CSFLE skip_crypt_shared - ${mongodb-versions}"
  exclude_spec:
    # CSFLE crypt_shared is available from MongoDB 6.0+
    - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable" }
  tasks:
    - name: "test-skip_crypt_shared"
