####################################### # Tools Driver Config for MCI # ####################################### mongo_tools_variables: ## Common download URLs (merge in as hashes) mongo_download_urls: osx_108: &mongo_url_osx108 mongo_url: "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-latest.tgz" solaris: &mongo_url_solaris mongo_url: "https://fastdl.mongodb.org/sunos5/mongodb-sunos5-x86_64-latest.tgz" rhel55_32: &mongo_url_rhell55_32 mongo_url: "https://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz" ubuntu1204: &mongo_url_ubuntu1204 mongo_url: "http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-ubuntu1204-latest.tgz" windows32-bit: &mongo_url_windows32 mongo_url: "https://fastdl.mongodb.org/win32/mongodb-win32-i386-latest.zip" windows64-bit: &mongo_url_windows64 mongo_url: "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-latest.zip" ## List of tests to run on each buildvariant mongo_tools_task_lists: osx_108_task_list: &osx_108_tasks - name: db - name: communityDist - name: legacy - name: unit rhel55_32_task_list: &rhel55_32_tasks - name: db - name: communityDist - name: legacy - name: unit solaris_task_list: &solaris_tasks - name: db - name: communityDist - name: legacy - name: unit ubuntu1204_task_list: &ubuntu1204_tasks - name: bsonutil - name: db - name: communityDist - name: enterpriseDist - name: json - name: legacy - name: lint - name: log - name: pool - name: progress - name: text - name: unit-coverage - name: util - name: vet windows_32_task_list: &windows_32_tasks - name: db - name: communityDist - name: legacy - name: unit windows_64_task_list: &windows_64_tasks - name: db - name: communityDist - name: enterpriseDist - name: legacy - name: unit ## Common mongodb arguments mongodb_arguments: default: &mongodb_default_startup_args mongodb_default_args: "--dbpath mongodb/db_files --port 27017 --httpinterface --setParameter=enableTestCommands=1 &" ssl: &mongodb_ssl_startup_args mongodb_ssl_args: "--sslMode requireSSL --sslCAFile src/src/github.com/mongodb/mongo-tools/common/db/openssl/testdata/ca.pem --sslPEMKeyFile src/src/github.com/mongodb/mongo-tools/common/db/openssl/testdata/server.pem" auth: &mongodb_auth_startup_args mongodb_auth_args: "--auth" functions: "attach coverage reports" : command: attach.task_files params: "${package} coverage report (HTML)": https://s3.amazonaws.com/mciuploads/mongo-tools/coverage/${package}/${task_id}.html "${package} coverage report (TXT)": https://s3.amazonaws.com/mciuploads/mongo-tools/coverage/${package}/${task_id}.txt "attach tool": command: attach.task_files params: "${tool} (${edition|community})": https://s3.amazonaws.com/mciuploads/mongo-tools/binaries/${build_id}/${edition|community}/${tool}${extension} "build tool": command: shell.exec params: working_dir: src script: | set -o verbose if [ "Windows_NT" = "$OS" ]; then export GOPATH=$(cygpath -w $(pwd)); else export GOPATH=`pwd`; fi; echo "Building ${tool}..." go build ${args} ${build_tags} -o ${tool} github.com/mongodb/mongo-tools/${tool}/main "download mongod": command: shell.exec params: working_dir: src script: | rm -rf mongodb mkdir mongodb cd mongodb curl -s ${mongo_url} --output mongodb.tgz ${decompress} mongodb.tgz chmod +x ./mongodb-*/bin/* mv ./mongodb-*/bin/* . "fetch tool" : command: s3.get params: bucket: mciuploads aws_key: ${aws_key} aws_secret: ${aws_secret} local_file: src/${tool}${extension} remote_file: mongo-tools/binaries/${build_id}/${edition|community}/${tool}${extension} "generate coverage html + text": command: shell.exec params: working_dir: src script: | set -o verbose if [ "Windows_NT" = "$OS" ]; then export GOPATH=$(cygpath -w $(pwd)); else export GOPATH=`pwd`; fi; if [ "${coverage}" = "true" ]; then go tool cover -html=coverage.out -o coverage.html go tool cover -func=coverage.out -o coverage.txt fi; "get buildnumber": command: keyval.inc params: key: "${build_variant}_tools" destination: "builder_num" "move coverage data": command: shell.exec params: working_dir: src script: | set -o verbose if [ "Windows_NT" = "$OS" ]; then export GOPATH=$(cygpath -w $(pwd)); else export GOPATH=`pwd`; fi; if [ "${coverage}" = "true" ]; then mv src/github.com/mongodb/mongo-tools/${package}/coverage.out $GOPATH fi; "run unit test": command: gotest.run params: working_dir: src tests: - dir: src/github.com/mongodb/mongo-tools/${package} args: ${coverage_args} ${args} ${build_tags} "setup integration test": command: shell.exec params: working_dir: src script: | if [ '${run_kinit}' = 'true' ] then echo "${kerberos_password}" | kinit -p drivers@LDAPTEST.10GEN.CC; fi "run tool tests": command: gotest.run params: working_dir: src tests: # TODO bsondump needs tests # TODO mongodump needs tests # TODO mongotop needs tests - dir: src/github.com/mongodb/mongo-tools/mongoimport args: ${coverage_args} ${args} - dir: src/github.com/mongodb/mongo-tools/mongoexport args: ${coverage_args} ${args} - dir: src/github.com/mongodb/mongo-tools/mongostat args: ${coverage_args} ${args} - dir: src/github.com/mongodb/mongo-tools/mongooplog args: ${coverage_args} ${args} - dir: src/github.com/mongodb/mongo-tools/mongorestore args: ${coverage_args} ${args} - dir: src/github.com/mongodb/mongo-tools/mongofiles args: ${coverage_args} ${args} 2>&1 > /dev/null; MONGOSHIM=./mongoshim${extension} go test -v ${coverage_args} ${args} "setup credentials" : command: shell.exec params: working_dir: src silent: true script: | cat > mci.buildlogger < retVal - command: attach.results params: file_location: src/report.json - command: shell.exec params: script: | set -o errexit ${killall_mci|pkill -9 mongo; pkill -9 mongodump; pkill -9 mongoexport; pkill -9 mongoimport; pkill -9 mongofiles; pkill -9 mongooplog; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongotop; pkill -9 mongod; pkill -9 mongos; pkill -f buildlogger.py; pkill -f smoke.py} exit $(cat retVal) - name: lint commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: shell.exec params: working_dir: src script: | set -o errexit set -o verbose if [ "Windows_NT" = "$OS" ]; then export GOPATH=$(cygpath -w $(pwd)); else export GOPATH=`pwd`; fi; retVal=$(go run src/github.com/3rf/mongo-lint/golint/golint.go src/github.com/mongodb/mongo-tools/); if [ "$retVal" = "" ]; then exit 0; else exit 1; fi; - name: log commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: expansions.update params: updates: - key: "package" value: "common/log" - func: "run unit test" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - name: pool commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: expansions.update params: updates: - key: "package" value: "common/pool" - func: "run unit test" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - name: progress commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: expansions.update params: updates: - key: "package" value: "common/progress" - func: "run unit test" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - name: text commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: expansions.update params: updates: - key: "package" value: "common/text" - func: "run unit test" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - name: unit commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - func: "download mongod" - command: shell.exec params: working_dir: src script: | set -o verbose cp ./mongodb/mongoshim${extension} src/github.com/mongodb/mongo-tools/mongofiles - func: "start mongod" - func: "run tool tests" - name: unit-coverage commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - func: "download mongod" - command: shell.exec params: working_dir: src script: | set -o verbose cp ./mongodb/mongoshim${extension} src/github.com/mongodb/mongo-tools/mongofiles - func: "start mongod" - func: "run tool tests" - command: expansions.update params: updates: - key: "package" value: "mongoimport" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" vars: format: "txt" content_type: "text/plain" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - command: expansions.update params: updates: - key: "package" value: "mongoexport" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" vars: format: "txt" content_type: "text/plain" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - command: expansions.update params: updates: - key: "package" value: "mongostat" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" vars: format: "txt" content_type: "text/plain" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - command: expansions.update params: updates: - key: "package" value: "mongooplog" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" vars: format: "txt" content_type: "text/plain" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - command: expansions.update params: updates: - key: "package" value: "mongorestore" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" vars: format: "txt" content_type: "text/plain" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - command: expansions.update params: updates: - key: "package" value: "mongofiles" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" vars: format: "txt" content_type: "text/plain" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - name: util commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: expansions.update params: updates: - key: "package" value: "common/util" - func: "run unit test" - func: "move coverage data" - func: "generate coverage html + text" - func: "upload coverage report" - func: "upload coverage report" vars: format: "html" content_type: "text/html" - func: "attach coverage reports" - name: vet commands: - command: git.get_project params: directory: src - command: git.apply_patch params: directory: src - func: "setup go env" - command: shell.exec params: working_dir: src script: | set -o verbose if [ "Windows_NT" = "$OS" ]; then export GOPATH=$(cygpath -w $(pwd)); else export GOPATH=`pwd`; fi; retVal=$(go tool vet src/github.com/mongodb/mongo-tools/); if [ "$retVal" = "" ]; then exit 0; else exit 1; fi; buildvariants: ####################################### # OSX Buildvariant # ####################################### - name: osx-108 display_name: OSX 10.8 64-bit run_on: - osx-108 expansions: <<: *mongo_url_osx108 <<: *mongodb_default_startup_args tasks: *osx_108_tasks ####################################### # RHEL Buildvariant # ####################################### - name: linux-32 display_name: Linux 32-bit disabled: true run_on: - rhel55-32 expansions: <<: *mongo_url_rhell55_32 <<: *mongodb_default_startup_args tasks: *rhel55_32_tasks ####################################### # Ubuntu Buildvariants # ####################################### - name: ubuntu display_name: Linux 64-bit run_on: - ubuntu1204-test expansions: <<: *mongo_url_ubuntu1204 <<: *mongodb_default_startup_args coverage: true coverage_args: "-coverprofile=coverage.out" tasks: *ubuntu1204_tasks - name: ubuntu-kerberos display_name: Linux 64-bit Kerberos run_on: - ubuntu1204-test expansions: <<: *mongo_url_ubuntu1204 <<: *mongodb_default_startup_args coverage: true coverage_args: "-coverprofile=coverage.out" build_tags: "-tags sasl" run_kinit: true tasks: *ubuntu1204_tasks ####################################### # Solaris Buildvariant # ####################################### - name: solaris display_name: Solaris 64-bit run_on: - solaris expansions: <<: *mongo_url_solaris <<: *mongodb_default_startup_args tasks: *solaris_tasks ####################################### # Windows Buildvariants # ####################################### - name: windows-32 display_name: Windows 32-bit run_on: - windows-32 expansions: <<: *mongo_url_windows32 <<: *mongodb_default_startup_args extension: .exe preproc_gpm: "perl -pi -e 's/\\r\\n/\\n/g' " tasks: *windows_32_tasks - name: windows-64 display_name: Windows 64-bit run_on: - windows-64-vs2013-test expansions: <<: *mongo_url_windows64 <<: *mongodb_default_startup_args extension: .exe preproc_gpm: "perl -pi -e 's/\\r\\n/\\n/g' " tasks: *windows_64_tasks