Is there a way to run test scenarios in parallel to reduce execution time

1,252 views
Skip to first unread message

Kiran

unread,
Nov 28, 2014, 4:54:26 AM11/28/14
to cu...@googlegroups.com
I was looking into parallelization of execution of scenarios because we have 2000+ tests, which take more than a day to run..

So, Is there a way cucumber can distribute scenarios to run on multiple browser instances and consolidate test results, as if we are running tests sequentially.

1 report - many browser instances(as configured by user) - reduced test execution time? Is someone else looking into this?

Any help would be appreciated. 

-K


David Kowis

unread,
Nov 29, 2014, 2:37:02 PM11/29/14
to cu...@googlegroups.com
I think you have fallen into the test trap:

http://tooky.co.uk/the-cucumber-test-trap/

The best solution for you is probably going to be evaluating if you
really need to have 2000+ cucumber scenarios. It's very difficult to
parallelize cucumber scenarios and needing to do it is a symptom of not
using Cucumber the way Cucumber is meant to be used.

Good luck,
David Kowis
> --
> Posting rules: http://cukes.info/posting-rules.html
> ---
> You received this message because you are subscribed to the Google
> Groups "Cukes" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cukes+un...@googlegroups.com
> <mailto:cukes+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

signature.asc

Simon Dean

unread,
Nov 29, 2014, 5:37:28 PM11/29/14
to cu...@googlegroups.com

> I was looking into parallelization of execution of scenarios because we have 2000+ tests, which take more than a day to run..
>
> So, Is there a way cucumber can distribute scenarios to run on multiple browser instances and consolidate test results, as if we are running tests sequentially.
>
> 1 report - many browser instances(as configured by user) - reduced test execution time? Is someone else looking into this?

If you're using cucumber-js, you can parallelise your tests with parallel-cucumber-js

https://www.npmjs.org/package/parallel-cucumber

https://github.com/simondean/parallel-cucumber-js

It uses child processes to parallelise the execution of features. I've seen a 80-90% reduction in test execution time using it. You can easily run 10+ tests in parallel if using PhantomJS as your browser or a Selenium Grid.

Aslak Hellesøy

unread,
Nov 29, 2014, 6:52:43 PM11/29/14
to cu...@googlegroups.com
What David said.

But if you don't feel like heeding that advice:


I haven't tried it myself - I keep my cukes fast and few - I've never needed parallel cukes.

Aslak
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.

Simon Dean

unread,
Nov 30, 2014, 11:46:02 AM11/30/14
to cu...@googlegroups.com

> I haven't tried it myself - I keep my cukes fast and few - I've never needed parallel cukes.

There can be some utility in reducing execution time from 20mins to say 4mins or even 1hour to ~12mins. I wonder what would people consider to be fast for a serially executed set of features?

A day's worth of tests does seem like a massive amount of tests.

aslak hellesoy

unread,
Nov 30, 2014, 3:21:52 PM11/30/14
to Cucumber Users
On Sun, Nov 30, 2014 at 4:45 PM, Simon Dean <si...@simondean.org> wrote:

> I haven't tried it myself - I keep my cukes fast and few - I've never needed parallel cukes.

There can be some utility in reducing execution time from 20mins to say 4mins or even 1hour to ~12mins.

Absolutely. And the best way to do that is usually to remove slow end-to-end tests and move more of the tests down in the stack where they execute faster.
 
I wonder what would people consider to be fast for a serially executed set of features?


It depends on context, but if it takes more than a minute it's slow in my opinion.

Aslak
 
A day's worth of tests does seem like a massive amount of tests.

Anite Sridhar

unread,
Nov 27, 2015, 6:35:50 AM11/27/15
to Cukes
Hi Simon Dean,

I am new to Cucumberjs, i have setup cucumber-mink to run cucumber features sequentially with Selenium Standalone server on Chrome browser..
Can you please help me to setup parallel execution on Chrome browser/PhantomJS browser with Selenium grid. 

Thanks in advance,
Anite
Reply all
Reply to author
Forward
0 new messages