temyers / cucumber-jvm-parallel-plugin

Maven plugin to help running Cucumber features in parallel
Apache License 2.0
129 stars 122 forks source link

Test not executing parallely - instead executing one by one #163

Closed thamizhkumarana closed 6 years ago

thamizhkumarana commented 6 years ago

Please find my configuration below:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <forkCount>2</forkCount>
                        <reuseForks>false</reuseForks>
                        <includes>
                            <include>**/*IT.java</include>
                        </includes>
                        <!--runOrder>alphabetical</runOrder-->
                        <argLine>-Duser.language=en</argLine>
                        <argLine>-Xmx512m</argLine>
                        <argLine>-XX:MaxPermSize=256m</argLine>
                        <argLine>-Dfile.encoding=UTF-8</argLine>
                        <systemPropertyVariables>
                            <!--<cucumber.options>&#45;&#45;tags @example</cucumber.options>-->
                        </systemPropertyVariables>
                    </configuration>
                    <executions>
                        <execution>
                            <id>failsafe-integration-test</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>integration-test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.github.temyers</groupId>
                    <artifactId>cucumber-jvm-parallel-plugin</artifactId>
                    <version>2.2.0</version>
                    <executions>
                        <execution>
                            <id>generateRunners</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>generateRunners</goal>
                            </goals>
                            <configuration>
                                <!-- Mandatory -->
                                <glue>stepdef</glue>
                                <!-- These are the default values -->
                                <outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
                                <featuresDirectory>src/it/resources/com/delta/project/integration/userstory/features_delta/features/</featuresDirectory>
                                <cucumberOutputDir>target/cucumber-reports</cucumberOutputDir>
                                <format>json</format>
                                <filterFeaturesByTags>true</filterFeaturesByTags>
                                <namingScheme>pattern</namingScheme>
                                <namingPattern>{f}_{c}IT</namingPattern>
                                <parallelScheme>SCENARIO</parallelScheme>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration combine.self="override">
                        <testFailureIgnore>true</testFailureIgnore>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.masterthought</groupId>
                    <artifactId>maven-cucumber-reporting</artifactId>
                    <version>2.3.0</version>
                    <executions>
                        <execution>
                            <id>execution</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                            <configuration>
                                <projectName>Integration Test</projectName>
                                <outputDirectory>${project.build.directory}/cucumber-html-reports</outputDirectory>
                                <cucumberOutput>${project.build.directory}/json/cucumber.json</cucumberOutput>
                                <parallelTesting>false</parallelTesting>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
thamizhkumarana commented 6 years ago

It started the tested as one by one: [INFO] skip non existing resourceDirectory /Users/mobiledelta/Documents/regression/DeltaFrame/selenium/src/test/resources [INFO] Copying 215 resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ selenium --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ selenium ---


T E S T S

Running Test_01IT 18:21:07.461 [main] INFO utility.Reader.yamlReader - Key = browser 18:21:07.473 [main] INFO utility.Reader.yamlReader - Value = iosapp 18:21:07.473 [main] INFO utility.

like this..

Can any one please advice me on this please.

Thanks, Thamizh

zdenek-jonas commented 6 years ago

I use maven-surefire and it works: http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html

mpkorstanje commented 6 years ago

The cucumber-jvm-parallel-plugin only generates the runners. It does not execute them. Please ensure the generated code is as expected and that you can execute regular junit tests in parallel.

If you still believe this is a problem with cucumber-jvm-parallel-plugin please create an mvce, preferably in the form of a github repo.

thamizhkumarana commented 6 years ago

thanks mpkorstanje,

It's worked with failsafe plugin.