Package: pytest-cloud
Distributed tests planner plugin for pytest testing frameworkInstall pytest-cloudpip install pytest-cloud

# install GNU parallel utility
# https://www.gnu.org/software/parallel/
# for MacOS, you can use:
brew install parallelFeaturesThe plugin provides an easy way of running tests among several test nodes (workers).
Uses the greatpytest-xdistplugin for actual distributed run.
When used, it will automatically detect capabilites of given node(s) and run only the number of test processes it is
able to handle. If will also filter out offline nodes or nodes which were failed to respond to the
capabilities acquisition call.Supports automatic codebase propagation to the test nodes, so you don’t have to install python dependencies
for your project on remote test nodes globally - just make sure that your virtualenv folder isinsideyour project folder - that’s a requirement.
It will also detect a root folder of the test environment (project root), and willrsyncit to all test nodes.NOTE:
>pytest-cloudusesvirtualenvinstead of built-invenvpackage.ATM only ssh transport is supported. So ensure that you have at least public key auth enabled to your test nodes
from the master node (where py.test is executed).Command-line options–cloud-nodeNode hostname (oruser@hostname) to run tests on. Multiple allowed.–cloud-nodesSpace-separated list of node hostname (oruser@hostname) to run tests on. Multiple allowed.–cloud-pythonOptional python executable name to be used on the remote test nodes.
Default is the executable name used for the test run on the master.–cloud-chdirOptional relative path to be used on the remote test nodes as target folder for syncing file and run tests.
Default ispytest_<username>_<current_folder_name>.–cloud-virtualenv-pathOptional relative path to the virtualenv to be used on the remote test nodes. By default it will try to detect
whether current test process is using virtualenv and if it’s located inside of the current directory. If that’s
the case, it will use it for rsync on the remote node(s).–cloud-mem-per-processOptional amount of memory roughly needed for test process, in megabytes.
Will be used to calculate amount of test processes per node, getting the free memory, dividing it for the memory
per process needed, and getting the minimum of that value and the number of CPU cores of the test node.–cloud-max-processesOptional maximum number of processes per test node. Overrides from above the calculated number
of processes using memory and number of CPU cores.–cloud-rsync-bandwidth-limitOptional bandwidth limit perrsyncprocess, in kilobytes per second. 5000 by default.–cloud-rsync-max-processesOptional process count limit forrsyncprocesses. By default there’s no limit so rsyncing will be in parallel
for all test nodes.–cloud-rsync-cipherOptional ssh cipher selection forrsyncprocesses.aes128-gcm@openssh.comby default.
Default cipher is chosen to have the least possible network overhead. Network overhead is system, compilation
and CPU architecture dependent, however chosen cipher is showing good results in majority of use cases.Ini file optionscloud_develop_eggsOptional list of python package paths to install in development mode on remote side. Required to be inside of the
project root directory.Examplepy.testtests/--cloud-node=10.0.120.{1..40}--cloud-mem-per-process=1000--rsyncdir=.Or if you pass list of nodes as space-separated list:py.testtests/--cloud-nodes='10.0.120.1 10.0.120.2'--cloud-mem-per-process=1000--rsyncdir=.ContactIf you have questions, bug reports, suggestions, etc. please create an issue on
theGitHub project page.LicenseThis software is licensed under theMIT licenseSeeLicense file© 2015 Anatoly Bubenkov and others.AuthorsAnatoly Bubenkovoriginal idea and implementation, new features and improvementsOleg Pidsadnyibugfixes and further improvementsThese people have contributed topytest-cloud, in alphabetical order:Andreas PelmeDariusz SmigielLoic DacharyMichael OvermeyerOrthographic PedantZac Hatfield-DoddsChangelog5.0.3Fixes issue #21 (dasm)Fully dropped python2 support (dasm)Added explicit requirement for virtualenv (dasm)5.0.2Remove python2 support (bubenkoff)5.0.1Correctly handle default venv location (bubenkoff)5.0.0Compatible with pytest-xdist >= 1.26.0including2.0.0+ (Zac-HD)4.0.0Add config option to select cipher for ssh connection (dasm)Fix deprecation warnings for pytest (dasm)Support pytest-xdist >= 1.26.0 (dasm)Support pytest >= 3.6.1 (dasm)Remove support for Python 3.0, 3.1, 3.2, 3.3 (consistent with pytest-xdist) (dasm)3.0.1support python 3.7 (bubenkoff)3.0.0support pytest-xdist >=1.22.1 (bubenkoff)2.0.0pytest fixed version number is removed from the requirements (olegpidsadnyi)removed pytest-cache dependency (olegpidsadnyi)1.3.8Add verbosity to rsync progress (bubenkoff)1.3.4Add develop eggs setting to install packages on remote side in development mode (bubenkoff)1.2.16Correctly handle python path on remote side (bubenkoff)1.2.12Add rsync progress to the output, change default bandwidth limit (bubenkoff)1.2.11Fast native rsync instead of python based one (bubenkoff)1.1.0Avoid unnecessary multiple ssh connections to the same node (bubenkoff)1.0.25Correct virtualenv execution (bubenkoff)1.0.18Ensure plugin command line hook is executed first (bubenkoff)Correct free memory calculation (bubenkoff)1.0.15Add pyc files cleanup (bubenkoff)1.0.13Automatic discovery of the virtualenv (bubenkoff)Fixes to rsyncing (bubenkoff)Safer node id generation (bubenkoff)Guarantee uniqueness of provided nodes (bubenkoff)1.0.10Delete orphan files when rsyncing (bubenkoff)1.0.7Add possibility to pass node list as space separated (bubenkoff)1.0.6Initial public release