diff options
-rw-r--r-- | etc/evergreen.yml | 52 | ||||
-rwxr-xr-x | pytests/powertest.py | 3 | ||||
-rw-r--r-- | pytests/requirements.txt | 4 |
3 files changed, 25 insertions, 34 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml index 3ce6340ef7c..f02a3bece79 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -154,7 +154,6 @@ variables: aws_key_remote: ${powercycle_aws_key} aws_secret_remote: ${powercycle_aws_secret} -# TODO: Remove psutil from virtualenv_requirements when BUILD-3083 is done - &powercycle_ec2_instance aws_ec2_yml: aws_ec2.yml ec2_expire_hours: "24" @@ -170,7 +169,6 @@ variables: ssh_key_id: ${powercycle_ssh_key_id} standard_port: "20000" virtualenv_dir: venv_powercycle - virtualenv_requirements: psutil windows_crash_cmd: \"notmyfault/notmyfaultc64.exe -accepteula crash 1\" windows_crash_dl: https://download.sysinternals.com/files/NotMyFault.zip windows_crash_dir: notmyfault @@ -994,18 +992,6 @@ functions: "run powercycle test" : - command: shell.exec - params: - working_dir: src - script: | - set -o verbose - set -o errexit - - ${activate_virtualenv} - if [ ! -z "${virtualenv_requirements}" ]; then - pip install ${virtualenv_requirements} - fi - - - command: shell.exec type: test params: working_dir: src @@ -1351,7 +1337,8 @@ functions: set -o errexit ${activate_virtualenv} - pip install boto3==1.5.27 + pip install -r buildscripts/requirements.txt + pip install -r pytests/requirements.txt if [ ! -z "${subnet_id}" ]; then subnet_id="-n ${subnet_id}" @@ -1479,8 +1466,8 @@ functions: script: | set -o errexit ${activate_virtualenv} - # Copy buildscripts and mongoDB executables to the remote host. - file_param="--file buildscripts" + # Copy buildscripts, pytests and mongoDB executables to the remote host. + file_param="--file buildscripts --file pytests" mongo_executables="mongo mongod mongos" for executable in $mongo_executables do @@ -1503,22 +1490,21 @@ functions: script: | set -o errexit ${activate_virtualenv} - # Set up virtualenv and install python modules on remote, if required - if [ ! -z "${virtualenv_requirements}" ]; then - cmds="python_loc=\$(which ${python|/opt/mongodbtoolchain/v2/bin/python2})" - cmds="$cmds; if [ \"Windows_NT\" = \"$OS\" ]; then python_loc=\$(cygpath -w \$python_loc); fi" - cmds="$cmds; virtualenv --python \$python_loc --system-site-packages ${virtualenv_dir|venv}" - cmds="$cmds; activate=\$(find ${virtualenv_dir|venv} -name 'activate')" - cmds="$cmds; source \$activate" - cmds="$cmds; pip install ${virtualenv_requirements}" - ssh_connection_options="${ssh_identity} ${ssh_connection_options}" - $python buildscripts/remote_operations.py \ - --verbose \ - --userHost $USER@${private_ip_address} \ - --sshConnectionOptions "$ssh_connection_options" \ - --retries ${ssh_retries|0} \ - --commands "$cmds" - fi + # Set up virtualenv on remote. + cmds="python_loc=\$(which \${python|/opt/mongodbtoolchain/v2/bin/python2})" + cmds="$cmds; remote_dir=${remote_dir|.}" + cmds="$cmds; if [ \"Windows_NT\" = \"$OS\" ]; then python_loc=\$(cygpath -w \$python_loc); remote_dir=\$(cygpath -w \$remote_dir); fi" + cmds="$cmds; virtualenv --python \$python_loc --system-site-packages ${virtualenv_dir|venv}" + cmds="$cmds; activate=\$(find ${virtualenv_dir|venv} -name 'activate')" + cmds="$cmds; . \$activate" + cmds="$cmds; pip install -r \$remote_dir/pytests/requirements.txt" + ssh_connection_options="${ssh_identity} ${ssh_connection_options}" + $python buildscripts/remote_operations.py \ + --verbose \ + --userHost $USER@${private_ip_address} \ + --sshConnectionOptions "$ssh_connection_options" \ + --retries ${ssh_retries|0} \ + --commands "$cmds" - command: shell.exec params: diff --git a/pytests/powertest.py b/pytests/powertest.py index 0acbedab423..9c9a36b6a31 100755 --- a/pytests/powertest.py +++ b/pytests/powertest.py @@ -1621,7 +1621,8 @@ def mongo_validate_collections(mongo): invalid_colls = [] ebusy_colls = [] for db_name in mongo.database_names(): - for coll_name in mongo[db_name].collection_names(): + for coll in mongo[db_name].list_collections(filter={"type": "collection"}): + coll_name = coll["name"] res = mongo[db_name].command({"validate": coll_name, "full": True}) LOGGER.info("Validating %s %s: %s", db_name, coll_name, res) ebusy = "EBUSY" in res["errors"] or "EBUSY" in res["warnings"] diff --git a/pytests/requirements.txt b/pytests/requirements.txt new file mode 100644 index 00000000000..e08ce104f66 --- /dev/null +++ b/pytests/requirements.txt @@ -0,0 +1,4 @@ +# powertest +boto3 == 1.5.27 +psutil == 5.4.3 +pymongo == 3.6.1 |