<commit_before>#######################################
#       C Driver Config for MCI       #
#######################################

## Some variables for convenience:

c_driver_variables:

  test_list: &std_tests
    - name: "compile"
    - name: "integration test latest"

  ## Note that the in 3.0, the default storage engine is MMAPv1 and
  ## WiredTiger is opt-in, but in latest as of MongoDB 3.1.4, the
  ## default is WiredTiger and MMAPv1 is opt-in.
  # TODO: ONLY INTEGRATION TEST LATEST IS USED, CDRIVER-675
  storage_engine_test_list: &storage_engine_tests
    - name: "compile"
    - name: "integration test 3.0"
    - name: "integration test 3.0 with WiredTiger"
    - name: "integration test latest"
    - name: "integration test latest with MMAPv1"

  topology_test_list: &topology_tests
    - name: "compile"
    - name: "integration test 2.4"
    - name: "integration test 2.4 replica set"
    - name: "integration test 2.4 sharded"
    - name: "integration test 2.6"
    - name: "integration test 2.6 replica set"
    - name: "integration test 2.6 sharded"
    - name: "integration test 3.0"
    - name: "integration test 3.0 replica set"
    - name: "integration test 3.0 sharded"
    - name: "integration test latest"
    - name: "integration test latest replica set"
    - name: "integration test latest sharded"

  topology_test_no_auth_list: &topology_tests_no_auth
    - name: "compile"
    - name: "integration test 2.4 no auth"
    - name: "integration test 2.4 replica set no auth"
    - name: "integration test 2.4 sharded no auth"
    - name: "integration test 2.6 no auth"
    - name: "integration test 2.6 replica set no auth"
    - name: "integration test 2.6 sharded no auth"
    - name: "integration test 3.0 no auth"
    - name: "integration test 3.0 replica set no auth"
    - name: "integration test 3.0 sharded no auth"
    - name: "integration test latest no auth"
    - name: "integration test latest replica set no auth"
    - name: "integration test latest sharded no auth"

## Common download urls (merge in as hashes)
  mongo_download_url_prefixes:
    linux64: &mongo_url_linux64
      mongo_url_prefix: "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-"
    ubuntu1204: &mongo_url_ubuntu1204
      mongo_url_platform: "ubuntu1204-"
      <<: *mongo_url_linux64
    ubuntu1404: &mongo_url_ubuntu1404
      mongo_url_platform: "ubuntu1404-"
      <<: *mongo_url_linux64
    windows64: &mongo_url_windows64
      mongo_url_prefix: "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-"
      mongo_url_platform: ""
    windows32: &mongo_url_windows32
      mongo_url_prefix: "http://downloads.mongodb.org/win32/mongodb-win32-i386-"
    rhel55: &mongo_url_rhel55
      mongo_url_platform: "rhel57-"
      <<: *mongo_url_linux64
    rhel55_32: &mongo_url_rhel55_32
      mongo_url_prefix: "http://downloads.mongodb.org/linux/mongodb-linux-i686-"
    osx-108: &mongo_url_osx_108
      mongo_url_prefix: "http://downloads.mongodb.org/osx/mongodb-osx-x86_64-"
    solaris: &mongo_url_solaris
      mongo_url_prefix: "http://downloads.mongodb.org/sunos5/mongodb-sunos5-x86_64-"

  ## Common sets of CFLAGS
  cflags:
    standard: &cflags_64
      cflags: "-m64 -march=x86-64"
    standard_32: &cflags_32
      cflags: "-m32 -march=i386"
    osx_108: &cflags_osx_108
      cflags: "-m64 -march=x86-64"

  ## Extra $PATH entries
  paths:
    unix_path: &unix_path
      extra_path:
    osx_path: &osx_path
      extra_path:
    windows_path: &windows_path
      extra_path: /cygdrive/c/mongo-c-driver/bin:/cygdrive/c/openssl/bin
    solaris_path: &solaris_path
      extra_path: /opt/mongodbtoolchain/bin

  ## Scripts that are shared between buildvariants
  scripts:
    mongo_orchestration:
      windows: &mongo_orchestration_windows
        start_mongo_orchestration: |
          echo "Installing Mongo Orchestration..."
          trap 'set +o errexit; mongo-orchestration stop;' EXIT
          taskkill.exe /FI "IMAGENAME eq python.exe" /F
          taskkill.exe /FI "IMAGENAME eq mongod.exe" /F
          echo "Starting Mongo Orchestration..."
          echo "{ \"releases\": { \"default\": \"c:\\\\mongodb\\\\bin\" }, \"last_updated\": \"2014-08-29 20:57:00.000000\" }" > orchestration.config
          mongo-orchestration -f orchestration.config -e default -s wsgiref start --socket-timeout-ms=60000
          sleep 10
          curl -s http://localhost:8889/
      unix: &mongo_orchestration_unix
        start_mongo_orchestration: |
          echo "Installing Mongo Orchestration..."
          trap 'set +o errexit; mongo-orchestration stop;' EXIT
          echo "Starting Mongo Orchestration..."
          echo "{ \"releases\": { \"default\": \"`pwd`/mongodb/bin\" }, \"last_updated\": \"2014-08-29 20:57:00.000000\" }" > orchestration.config
          TMPDIR=/data/db mongo-orchestration -f orchestration.config -e default start --socket-timeout-ms=60000
          curl -s http://localhost:8889/
      start_topology_command: &start_topology_command
        start_topology: |
          curl -s --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL"
          ./mongodb/bin/mongo --eval 'printjson(db.serverBuildInfo())'
          ./mongodb/bin/mongo --eval 'printjson(db.isMaster())'

    compile:
      unix: &compile_unix
        compile_script: |
          set -o errexit
          set -o verbose
          ./autogen.sh --enable-ssl=yes --enable-sasl=yes
          make -j8
      solaris: &compile_solaris
        compile_script: |
          set -o errexit
          set -o verbose
          ./autogen.sh --enable-ssl=yes --enable-sasl=yes
          make
      msvc: &compile_msvc
        compile_script: |
          set -o errexit
          set -o verbose
          cmake="/cygdrive/c/cmake/bin/cmake"
          msbuild="/cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe"
          dumpbin="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/dumpbin.exe"
          # In Autotools builds, autogen.sh does this, we must do it here.
          git submodule init
          git submodule update
          cd src/libbson
          "$cmake" -G "$GENERATOR" "-DCMAKE_INSTALL_PREFIX=C:/mongo-c-driver"
          "$msbuild" /m ALL_BUILD.vcxproj
          "$dumpbin" /HEADERS Debug/libbson-1.0.dll | head -n 25
          "$msbuild" /m INSTALL.vcxproj
          cd ../..
          "$cmake" -G "$GENERATOR" "-DCMAKE_INSTALL_PREFIX=C:/mongo-c-driver" "-DBSON_ROOT_DIR=C:/mongo-c-driver" "$CMAKE_DEFS"
          "$msbuild" /m ALL_BUILD.vcxproj
          "$dumpbin" /HEADERS Debug/mongoc-1.0.lib | head -n 25
          "$msbuild" /m INSTALL.vcxproj

    username_password:
      common: &username_password_common
        set_username_password: |
          export MONGOC_TEST_USER=bob
          export MONGOC_TEST_PASSWORD=<PASSWORD>

    integration_tests:
      msvc: &run_integration_tests_msvc
        run_integration_tests: |
          export PATH=$PATH:`pwd`/tests
          ./tests/make_ca.pl tests/trust_dir tests/trust_dir.cnf
          touch tests/trust_dir/done
          export PATH=$PATH:`pwd`/Debug:`pwd`/src/libbson/Debug
          ./Debug/test-libmongoc.exe -f -p
      unix: &run_integration_tests_unix
        run_integration_tests: |
          make check

## Other OS-specific attributes, grouped by OS
  unix_common: &unix_common
    <<: *username_password_common
    <<: *compile_unix
    <<: *mongo_orchestration_unix
    <<: *run_integration_tests_unix
    <<: *start_topology_command
    <<: *unix_path

  osx_common: &osx_common
    <<: *unix_common
    <<: *osx_path

  solaris_common: &solaris_common
    <<: *unix_common
    <<: *compile_solaris
    <<: *solaris_path

## Misc. for Windows builds
  windows_compilers:
    ## msvc2010
    msvc2010: &with_msvc2010
      <<: *username_password_common
      generator: Visual Studio 10 2010
      msbuild: # ???
      dllpath: "c:/openssl/bin,c:/sasl/bin,c:/curl/dlls"
    ## msvc2013, 32-bit
    msvc2013_32bit: &with_msvc2013_32bit
      generator: Visual Studio 12 2013
      cmake_defs: "-DSEARCH_OPEN_SSL:BOOL=OFF"
      msbuild: /cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe
    msvc2013: &with_msvc2013
      <<: *username_password_common
      generator: Visual Studio 12 2013 Win64
      cmake_defs: "-DCMAKE_INCLUDE_PATH=C:/sasl/include -DCMAKE_LIBRARY_PATH=C:/sasl/lib"
      msbuild: /cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe
      dllpath: "c:/openssl/bin,c:/sasl/bin"

  ## all windows buildvariants have these attributes in common
  windows_common: &windows_common
    mongo_url_extension: "zip"
    extension: ".exe"
    windows: true
    <<: *windows_path
    <<: *mongo_orchestration_windows
    <<: *start_topology_command

  msvc_common: &msvc_common
    <<: *windows_common
    <<: *compile_msvc
    <<: *run_integration_tests_msvc


#######################################
#            Functions                #
#######################################

functions:
  "fetch source" :
    command: git.get_project
    params:
      directory: mongo-c-driver

  "fetch mongodb" :
    command: shell.exec
    params:
      working_dir: "mongo-c-driver"
      script: |
        set -o verbose
        set -o errexit
        curl -s ${mongo_url} --output mongo-archive.${ext|tgz}
        ${decompress} mongo-archive.${ext|tgz}
        mv mongodb* mongodb
        chmod +x ./mongodb/bin/mongod${extension}

  "create working directory" :
    command: shell.exec
    params:
      script: |
        rm -rf mongo-c-driver<commit_msg>fix .mci.yml to start mongod on windows<commit_after>#######################################
#       C Driver Config for MCI       #
#######################################

## Some variables for convenience:

c_driver_variables:

  test_list: &std_tests
    - name: "compile"
    - name: "integration test latest"

  ## Note that the in 3.0, the default storage engine is MMAPv1 and
  ## WiredTiger is opt-in, but in latest as of MongoDB 3.1.4, the
  ## default is WiredTiger and MMAPv1 is opt-in.
  # TODO: ONLY INTEGRATION TEST LATEST IS USED, CDRIVER-675
  storage_engine_test_list: &storage_engine_tests
    - name: "compile"
    - name: "integration test 3.0"
    - name: "integration test 3.0 with WiredTiger"
    - name: "integration test latest"
    - name: "integration test latest with MMAPv1"

  topology_test_list: &topology_tests
    - name: "compile"
    - name: "integration test 2.4"
    - name: "integration test 2.4 replica set"
    - name: "integration test 2.4 sharded"
    - name: "integration test 2.6"
    - name: "integration test 2.6 replica set"
    - name: "integration test 2.6 sharded"
    - name: "integration test 3.0"
    - name: "integration test 3.0 replica set"
    - name: "integration test 3.0 sharded"
    - name: "integration test latest"
    - name: "integration test latest replica set"
    - name: "integration test latest sharded"

  topology_test_no_auth_list: &topology_tests_no_auth
    - name: "compile"
    - name: "integration test 2.4 no auth"
    - name: "integration test 2.4 replica set no auth"
    - name: "integration test 2.4 sharded no auth"
    - name: "integration test 2.6 no auth"
    - name: "integration test 2.6 replica set no auth"
    - name: "integration test 2.6 sharded no auth"
    - name: "integration test 3.0 no auth"
    - name: "integration test 3.0 replica set no auth"
    - name: "integration test 3.0 sharded no auth"
    - name: "integration test latest no auth"
    - name: "integration test latest replica set no auth"
    - name: "integration test latest sharded no auth"

## Common download urls (merge in as hashes)
  mongo_download_url_prefixes:
    linux64: &mongo_url_linux64
      mongo_url_prefix: "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-"
    ubuntu1204: &mongo_url_ubuntu1204
      mongo_url_platform: "ubuntu1204-"
      <<: *mongo_url_linux64
    ubuntu1404: &mongo_url_ubuntu1404
      mongo_url_platform: "ubuntu1404-"
      <<: *mongo_url_linux64
    windows64: &mongo_url_windows64
      mongo_url_prefix: "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-"
      mongo_url_platform: ""
    windows32: &mongo_url_windows32
      mongo_url_prefix: "http://downloads.mongodb.org/win32/mongodb-win32-i386-"
    rhel55: &mongo_url_rhel55
      mongo_url_platform: "rhel57-"
      <<: *mongo_url_linux64
    rhel55_32: &mongo_url_rhel55_32
      mongo_url_prefix: "http://downloads.mongodb.org/linux/mongodb-linux-i686-"
    osx-108: &mongo_url_osx_108
      mongo_url_prefix: "http://downloads.mongodb.org/osx/mongodb-osx-x86_64-"
    solaris: &mongo_url_solaris
      mongo_url_prefix: "http://downloads.mongodb.org/sunos5/mongodb-sunos5-x86_64-"

  ## Common sets of CFLAGS
  cflags:
    standard: &cflags_64
      cflags: "-m64 -march=x86-64"
    standard_32: &cflags_32
      cflags: "-m32 -march=i386"
    osx_108: &cflags_osx_108
      cflags: "-m64 -march=x86-64"

  ## Extra $PATH entries
  paths:
    unix_path: &unix_path
      extra_path:
    osx_path: &osx_path
      extra_path:
    windows_path: &windows_path
      extra_path: /cygdrive/c/mongo-c-driver/bin:/cygdrive/c/openssl/bin
    solaris_path: &solaris_path
      extra_path: /opt/mongodbtoolchain/bin

  ## Scripts that are shared between buildvariants
  scripts:
    mongo_orchestration:
      windows: &mongo_orchestration_windows
        start_mongo_orchestration: |
          echo "Installing Mongo Orchestration..."
          trap 'set +o errexit; mongo-orchestration stop;' EXIT
          taskkill.exe /FI "IMAGENAME eq python.exe" /F
          taskkill.exe /FI "IMAGENAME eq mongod.exe" /F
          echo "Starting Mongo Orchestration..."
          echo "{ \"releases\": { \"default\": \"c:\\\\mongodb\\\\bin\" }, \"last_updated\": \"2014-08-29 20:57:00.000000\" }" > orchestration.config
          mongo-orchestration -f orchestration.config -e default -s wsgiref start --socket-timeout-ms=60000
          sleep 10
          curl -s http://localhost:8889/
      unix: &mongo_orchestration_unix
        start_mongo_orchestration: |
          echo "Installing Mongo Orchestration..."
          trap 'set +o errexit; mongo-orchestration stop;' EXIT
          echo "Starting Mongo Orchestration..."
          echo "{ \"releases\": { \"default\": \"`pwd`/mongodb/bin\" }, \"last_updated\": \"2014-08-29 20:57:00.000000\" }" > orchestration.config
          TMPDIR=/data/db mongo-orchestration -f orchestration.config -e default start --socket-timeout-ms=60000
          curl -s http://localhost:8889/
      start_topology_command: &start_topology_command
        start_topology: |
          curl -s --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL"
          ./mongodb/bin/mongo --eval 'printjson(db.serverBuildInfo())'
          ./mongodb/bin/mongo --eval 'printjson(db.isMaster())'

    compile:
      unix: &compile_unix
        compile_script: |
          set -o errexit
          set -o verbose
          ./autogen.sh --enable-ssl=yes --enable-sasl=yes
          make -j8
      solaris: &compile_solaris
        compile_script: |
          set -o errexit
          set -o verbose
          ./autogen.sh --enable-ssl=yes --enable-sasl=yes
          make
      msvc: &compile_msvc
        compile_script: |
          set -o errexit
          set -o verbose
          cmake="/cygdrive/c/cmake/bin/cmake"
          msbuild="/cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe"
          dumpbin="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/dumpbin.exe"
          # In Autotools builds, autogen.sh does this, we must do it here.
          git submodule init
          git submodule update
          cd src/libbson
          "$cmake" -G "$GENERATOR" "-DCMAKE_INSTALL_PREFIX=C:/mongo-c-driver"
          "$msbuild" /m ALL_BUILD.vcxproj
          "$dumpbin" /HEADERS Debug/libbson-1.0.dll | head -n 25
          "$msbuild" /m INSTALL.vcxproj
          cd ../..
          "$cmake" -G "$GENERATOR" "-DCMAKE_INSTALL_PREFIX=C:/mongo-c-driver" "-DBSON_ROOT_DIR=C:/mongo-c-driver" "$CMAKE_DEFS"
          "$msbuild" /m ALL_BUILD.vcxproj
          "$dumpbin" /HEADERS Debug/mongoc-1.0.lib | head -n 25
          "$msbuild" /m INSTALL.vcxproj

    username_password:
      common: &username_password_common
        set_username_password: |
          export MONGOC_TEST_USER=bob
          export MONGOC_TEST_PASSWORD=<PASSWORD>

    integration_tests:
      msvc: &run_integration_tests_msvc
        run_integration_tests: |
          export PATH=$PATH:`pwd`/tests
          ./tests/make_ca.pl tests/trust_dir tests/trust_dir.cnf
          touch tests/trust_dir/done
          export PATH=$PATH:`pwd`/Debug:`pwd`/src/libbson/Debug
          ./Debug/test-libmongoc.exe -f -p
      unix: &run_integration_tests_unix
        run_integration_tests: |
          make check

## Other OS-specific attributes, grouped by OS
  unix_common: &unix_common
    <<: *username_password_common
    <<: *compile_unix
    <<: *mongo_orchestration_unix
    <<: *run_integration_tests_unix
    <<: *start_topology_command
    <<: *unix_path

  osx_common: &osx_common
    <<: *unix_common
    <<: *osx_path

  solaris_common: &solaris_common
    <<: *unix_common
    <<: *compile_solaris
    <<: *solaris_path

## Misc. for Windows builds
  windows_compilers:
    ## msvc2010
    msvc2010: &with_msvc2010
      <<: *username_password_common
      generator: Visual Studio 10 2010
      msbuild: # ???
      dllpath: "c:/openssl/bin,c:/sasl/bin,c:/curl/dlls"
    ## msvc2013, 32-bit
    msvc2013_32bit: &with_msvc2013_32bit
      generator: Visual Studio 12 2013
      cmake_defs: "-DSEARCH_OPEN_SSL:BOOL=OFF"
      msbuild: /cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe
    msvc2013: &with_msvc2013
      <<: *username_password_common
      generator: Visual Studio 12 2013 Win64
      cmake_defs: "-DCMAKE_INCLUDE_PATH=C:/sasl/include -DCMAKE_LIBRARY_PATH=C:/sasl/lib"
      msbuild: /cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe
      dllpath: "c:/openssl/bin,c:/sasl/bin"

  ## all windows buildvariants have these attributes in common
  windows_common: &windows_common
    mongo_url_extension: "zip"
    extension: ".exe"
    windows: true
    <<: *windows_path
    <<: *mongo_orchestration_windows
    <<: *start_topology_command

  msvc_common: &msvc_common
    <<: *windows_common
    <<: *compile_msvc
    <<: *run_integration_tests_msvc


#######################################
#            Functions                #
#######################################

functions:
  "fetch source" :
    command: git.get_project
    params:
      directory: mongo-c-driver

  "fetch mongodb" :
    command: shell.exec
    params:
      working_dir: "mongo-c-driver"
      script: |
        set -o verbose
        set -o errexit
        curl -s ${mongo_url} --output mongo-archive.${ext|tgz}
        ${decompress} mongo-archive.${ext|tgz}
        mv mongodb* mongodb
        chmod +x ./mongodb/bin/mongod${extension}
        if [ ${windows|false} = true ]; then
            cp -r mongodb /cygdrive/c/mongodb
        fi

  "create working directory" :
    command: shell.exec
    params:
      script: |
        rm -rf mongo-c-driver
{'fraction_non_alphanumeric': 0.12894819138955488, 'fraction_numerical': 0.03346189930157407, 'mean_word_length': 2.6651384909264566, 'pattern_counts': {'":': 12, '<': 93, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4378125', 'n_tokens_mistral': 7239, 'n_tokens_neox': 6517, 'n_words': 1420}