Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parallel execution #141

Open
aman13garg opened this issue Apr 15, 2021 · 2 comments · May be fixed by #154
Open

Support parallel execution #141

aman13garg opened this issue Apr 15, 2021 · 2 comments · May be fixed by #154
Milestone

Comments

@aman13garg
Copy link

Hi @martinschneider I would like to know that do we support running tests in parallel on mobile. If yes then do let me know what's need to be done or if not then do let me know how we can achieve it . is there any possibility for same ?

@martinschneider martinschneider added this to the R1.10 milestone Jun 5, 2021
@martinschneider
Copy link
Owner

martinschneider commented Jun 5, 2021

Hi @aman13garg! Thank you for the request!

Parallel execution should already work with Cucumber as described here. I need a bit more time to understand why this doesn't work with JustTestLah!.

I'm also considering supporting TestNG in the next release which will allow better parallelization support with Cucumber (i.e. on scenario level instead of feature level).

@martinschneider martinschneider changed the title How to do parallel execution for tests Support Cucumber's parallel execution feature Jun 5, 2021
@martinschneider martinschneider changed the title Support Cucumber's parallel execution feature Support parallel execution Jun 6, 2021
@martinschneider
Copy link
Owner

martinschneider commented Jun 6, 2021

I found the issue. Parallel execution of tests is achieved by the Maven surefire or failsafe plugins. Both of them don't work with junit-vintage-engine which is needed to support JUnit 5 assertions in Cucumber. I've raised a bug for this: https://issues.apache.org/jira/browse/SUREFIRE-1918 (see also https://github.com/cucumber/cucumber-jvm/issues/2311).

There is an easy workaround! If you don't need JUnit 5, simply exclude org.junit.vintage:junit-vintage-engine from the Maven dependency in your pom.xml:

<dependency>
  <groupId>qa.justtestlah</groupId>
  <artifactId>justtestlah-core</artifactId>
  <version>${project.version}</version>
  <exclusions>
    <exclusion>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Then parallel execution can be achieved by adding this configuration:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <parallel>methods</parallel>
          <useUnlimitedThreads>true</useUnlimitedThreads>
        </configuration>
      </plugin>
      ...
  </plugins>
</build>

Have a look at #154. It still needs a bit of work and cleaning up but you can already use it do run tests in parallel. This will be fully supported and documented in release 1.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants