Semaphore lets you run Cucumber scenarios in parallel jobs. There are couple of ways to use this great feature:
Semaphore Boosters are the easiest way to automatically parallelize your Cucumber test suite. With Boosters you don't need to make any changes to your source code. To learn more about Boosters visit our documentation page.
Run cucumber tag groups in separate jobs.
RAILS_ENV=test CTAGS='--tags @tag_name' bundle exec rake cucumber default: features
You can use gem cucumber in groups and split your Cucumber features to run them separately.
You can split execution of scenarios by grouping them in subdirectories. e.g Let's say you have two directory within features, "foo" and "bar". Running scenarios from these two subdirectories in parallel jobs would be done as follows:
Note: In order for all the feature steps to be visible from each directory, you have to add the following line to your cucumber.yml file:
default: -r features
If you want to get faster feedback from CI then you can try knapsack gem. It will split tests across jobs and make sure that tests will run comparable time on each job.
For the first time run all scenarios at once with enabled report generator. Set up your build command:
After tests pass your should copy knapsack json report which is rendered at the end of cucumber results. Save it into your repository as knapsack_cucumber_report.json file and commit. More info about generating report you will find in knapsack docs.
Knapsack supports Semaphore ENVs SEMAPHORE_THREAD_COUNT and SEMAPHORE_CURRENT_THREAD. The only thing you need to do is set up knapsack cucumber command for as many jobs as you need. Here is an example:
Scenarios will be split across jobs.
Semaphore Docs are open source — Edit on GitHub