Parallel Processing in Serenity BDD

575 views
Skip to first unread message

Santosh Pillai

unread,
Sep 1, 2016, 9:24:27 AM9/1/16
to Serenity BDD Users Group
Any help regarding how to achieve parallel processing (executing multiple features at the same time) will be appreciated. So far I have tried :

I want to be able to run the feature files in parallel. What is the easiest and most effective way to achieve this?

So far I have

  1. Created separate Runner class for each feature and then used failsafe or surefire plugin -  This is something I don't want as I don't want a new runner for each feature file.

  2. Used the "cucumber-vm-parallel-plugin". I copy pasted below code in my pom file. Nothing happened. 

    <plugin>
    <groupId>com.github.temyers</groupId>
    <artifactId>cucumber-jvm-parallel-plugin</artifactId>
    <version>1.0.1</version>
    <executions>
        <execution>
            <id>generateRunners</id>
            <phase>validate</phase>
            <goals>
                <goal>generateRunners</goal>
            </goals>
            <configuration>
                <glue>com.automationrhapsody.cucumber.parallel.tests</glue>
                <featuresDirectory>src/test/resources/com</featuresDirectory>
                <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
                <format>json,html</format>
                <tags>"~@ignored"</tags>
            </configuration>
        </execution>
    </executions>

  3. Looked into Serenity documentation and ran my program using following parameters, but could not achieve parallel execution. 

mvn verify -Dthucydides.batch.count=2 -Dthucydides.batch.number=2

I'm stuck over here. Any help (easy and effective) will be appreciated. Also, please suggest how options 2 and 3 above can be done correctly

Martin Aas Andersen

unread,
Sep 1, 2016, 9:49:33 AM9/1/16
to Serenity BDD Users Group

Martin Aas Andersen

unread,
Sep 1, 2016, 9:51:09 AM9/1/16
to Serenity BDD Users Group
One problem i see is you're using thucydides params instead of serenity:

18.1. Splitting serenity tests to batches

To split tests to batches you need configure serenity run some tests and skip others. For different batches it will be different tests, below you can find short example of such configuration.

For configuration batches three parameters are used:

serenity.batch.strategy

Optional parameter for choosing batch creating strategy. Possible values are DIVIDE_EQUALLY and DIVIDE_BY_TEST_COUNT. Default value is DIVIDE_EQUALLY. Instead of it can be used redundant thucydides.batch.strategy, but it strongly not recommended

serenity.batch.size

This parameter should be the same for each batch, and should more than 0. This is amount of all bathes for current sources, and synonym of serenity.batch.count. Instead of it can be used redundant thucydides.batch.size, but it strongly not recommended

serenity.batch.count

This parameter should be the same for each batch, and should more than 0. This is amount of all bathes for current sources, and synonym of serenity.batch.size. Instead of it can be used redundant thucydides.batch.count, but it strongly not recommended

serenity.batch.number

This parameter should be different for each batch, and should be less or equal serenity.batch.size and more than 0. This is number of bath for execution in current build. Instead of it can be used redundant thucydides.batch.number, but it strongly not recommended


http://thucydides.info/docs/serenity-staging/#_running_serenity_tests_in_parallel_batches


Reply all
Reply to author
Forward
0 new messages