Option to run cucumber scenarios in parallel

1,612 views
Skip to first unread message

Naren Nala

unread,
Mar 1, 2015, 3:12:41 PM3/1/15
to cu...@googlegroups.com

I have made each of my test scenarios completely independent by using cucumber-guice ScenarioScoped objects. Now, I have the ability to run my cucumber scenarios in parallel. I have tried setting up the forkEvery and maxParallelForks in my gradle task. That doesn't seem to do the magic with JUnit. I am running my Cucumber feature files using the JUnit @Runwith option.

Please suggest if there are any options that I could try in being able to run my cucumber scenarios in parallel. Also, I am interested in running the scenarios in a multi-threaded fashion rather than running them in multiple JVMs.

aslak hellesoy

unread,
Mar 1, 2015, 3:34:04 PM3/1/15
to Cucumber Users
On Sat, Feb 28, 2015 at 5:56 PM, Naren Nala <nnarend...@gmail.com> wrote:

I have made each of my test scenarios completely independent by using cucumber-guice ScenarioScoped objects. Now, I have the ability to run my cucumber scenarios in parallel. I have tried setting up the forkEvery and maxParallelForks in my gradle task. That doesn't seem to do the magic with JUnit. I am running my Cucumber feature files using the JUnit @Runwith option.

Please suggest if there are any options that I could try in being able to run my cucumber scenarios in parallel. Also, I am interested in running the scenarios in a multi-threaded fashion rather than running them in multiple JVMs.


Cucumber-JVM doesn't support multi-threaded execution. (It might in the future). There are some 3rd party extensions and various workaround floating around, but I haven't tried any of them. 

Aslak

--
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.
For more options, visit https://groups.google.com/d/optout.

Damian Szczepanik

unread,
Mar 1, 2015, 4:54:47 PM3/1/15
to aslak hellesoy


> Cucumber-JVM doesn't support multi-threaded execution. (It might in the
> future). There are some 3rd party extensions and various workaround floating
> around, but I haven't tried any of them. 

That would be also helpful for me to execute, a few scenarios in the same time or at least repeat the same scenario n-times.

Can you remind us which extensions are you thinking about?

Thanks,
Damian

aslak hellesoy

unread,
Mar 1, 2015, 5:00:24 PM3/1/15
to Cucumber Users
I can't recall. Some maven stuff that launches several different JUnit runs in parallel.
 
Thanks,
Damian

Naren Nala

unread,
Mar 1, 2015, 10:17:14 PM3/1/15
to cu...@googlegroups.com
Thanks for the reply.. based on what I have read, there is a maven sure fire plugin. But, we are using gradle and I haven't found anything so far for gradle.

We are in the initial phase of migrating our tests to cucumber. Is there any plan for adding this feature into cucumber junit runner?

Aslak Hellesøy

unread,
Mar 2, 2015, 12:02:01 AM3/2/15
to cu...@googlegroups.com

On Monday, 2 March 2015 at 03:17, Naren Nala wrote:

Thanks for the reply.. based on what I have read, there is a maven sure fire plugin. But, we are using gradle and I haven't found anything so far for gradle.

We are in the initial phase of migrating our tests to cucumber. Is there any plan for adding this feature into cucumber junit runner?
There is a wish, but no plans. It wiuld require a big overhaul of cucumber-jvm to make the core thread safe.

One day maybe.

Tim Myerscough

unread,
Mar 5, 2015, 2:54:36 AM3/5/15
to cu...@googlegroups.com
Hi

This post describes an approach for using the Maven Failsafe plugin along side multiple JUnit cucumber test classes to run your tests in parallel.

I created a maven plugin to automatically generate a cucumber JUnit file for each feature file in your project and run in parallel using Failsafe.

The current version is: 
<dependency>
    <groupId>com.github.temyers</groupId>
    <artifactId>cucumber-jvm-parallel-plugin</artifactId>
    <version>0.1.0</version>
</dependency>

George Dinwiddie

unread,
Mar 5, 2015, 11:13:39 AM3/5/15
to cu...@googlegroups.com
On 3/2/15 12:01 AM, Aslak Hellesøy wrote:
>
> On Monday, 2 March 2015 at 03:17, Naren Nala wrote:
>
>> Thanks for the reply.. based on what I have read, there is a maven
>> sure fire plugin. But, we are using gradle and I haven't found
>> anything so far for gradle.
>>
>> We are in the initial phase of migrating our tests to cucumber. Is
>> there any plan for adding this feature into cucumber junit runner?
> There is a wish, but no plans. It wiuld require a big overhaul of
> cucumber-jvm to make the core thread safe.
>
> One day maybe.

I question the value. Often the tests interfere with each other on the
system being tested.

- George

--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

Tim Walker

unread,
Mar 5, 2015, 11:17:48 AM3/5/15
to cu...@googlegroups.com
Hi, 

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

One exception to this would be if the CI system could use dynamic slave executors such that each environment was completely isolated from the others. 

Tim

George Dinwiddie

unread,
Mar 5, 2015, 12:26:49 PM3/5/15
to cu...@googlegroups.com
Tim,

On 3/5/15 11:17 AM, Tim Walker wrote:
> Hi,
>
> On Thu, Mar 5, 2015 at 9:13 AM, George Dinwiddie
> <li...@idiacomputing.com <mailto:li...@idiacomputing.com>> wrote:
>
> On 3/2/15 12:01 AM, Aslak Hellesøy wrote:
>
>
> On Monday, 2 March 2015 at 03:17, Naren Nala wrote:
>
> Thanks for the reply.. based on what I have read, there is a
> maven
> sure fire plugin. But, we are using gradle and I haven't found
> anything so far for gradle.
>
> We are in the initial phase of migrating our tests to
> cucumber. Is
> there any plan for adding this feature into cucumber junit
> runner?
>
> There is a wish, but no plans. It wiuld require a big overhaul of
> cucumber-jvm to make the core thread safe.
>
> One day maybe.
>
>
> I question the value. Often the tests interfere with each other on
> the system being tested.
>
>
> One exception to this would be if the CI system could use dynamic slave
> executors such that each environment was completely isolated from the
> others.

If you're going to do that, it seems simpler for the CI system to run
isolated instances of Cucumber, also. That's where I think the
parallelism belongs.
Reply all
Reply to author
Forward
0 new messages