-
Notifications
You must be signed in to change notification settings - Fork 0
Parallel Execution
As of the time of this writing, parallel execution of scenarios/features is not yet officially supported in the official behave release. However, there have been a number of forks (one of which has an unfulfilled PR into behave) that offer parallel execution support, to varying degrees of success.
Make sure you've followed the main installation steps for this framework to get everything, including the base behave package, installed and configured into a new virtual environment. We'll use that as a base and then overwrite the standard behave package with one from a fork that implements parallelization.
$ cd web-bdd
$ git clone -b eparallel https://github.com/xrg/behave-parallel.git
$ cd behave-parallel
$ pipenv run python setup.py install
With the above behave-parallel fork installed over top of the base behave module, you can now specify the --processes and --parallel-element cmd line args when running scenarios, e.g.:
$ pipenv run behave --processes 4 --parallel-element feature -D headless=true
behave-parallel is not entirely bug free so that's why I recommend keeping a backup of the official behave branch. (And also why I would like to modify this whole process with a script that can install behave-parallel as a separate virtualenv package instead of overwriting existing packages.)
For instance, when running tests in parallel, even though all functionality will execute as you'd expect, the final output summary may falsely mark your steps/scenarios/features as untested rather than the expected passed or failed. For this reason, I don't recommend relying on the standard behave test results output for this and instead recommend using a custom logging / test results reporting mechanism when running tests in parallel.