0

So far I'm able to run cucumber-jvm tests in parallel by using multiple runner classes but as my project increasing and new features are adding up each time so it's getting really difficult to optimise execution time

So my question is what is the best approach to optimise execution time

  • Is it by adding new runner class for each feature/limiting to certain threads and updating runner class with new tags to execute

So far I'm using thread count 8 and I've runner classes are also 8

Using this approach is fine until now, but one of the feature has got more scenarios added recently and it's taking longer time to finish :( so how is it possible to optimise execution time here...

Any help much appreciated!!

Ranjith's
  • 4,508
  • 5
  • 24
  • 40
  • I use ruby cucumber, so I'm not sure what tools are available for java cucumber, but what we do is sort our tests into very long, long, average and short tests. We queue the longests test to run first and then long, average and fill in with fast tests at the end. This ensure our last test to start is fairly short test at a time when only other shorter tests should be in the queue. – Jeff Price Nov 11 '16 at 14:28
  • How can i use this approach for runner classes any idea?? – Ranjith's Nov 14 '16 at 13:49
  • This is may be the case where features are running in parallel not scenarios. If that is the case you can check http://stackoverflow.com/questions/40632453/cucumber-test-scenarios-running-in-parallel/40684652#40684652 – user861594 Dec 21 '16 at 09:25
  • Please have a look at http://stackoverflow.com/a/41100104/2895913 – Sugat Mankar Dec 21 '16 at 13:31

1 Answers1

0

This worked for me:

Courgette-JVM

It has added capabilities to run cucumber tests in parallel on a feature level or on a scenario level.

It also provides an option to automatically re-run failed scenarios.

Usage

@RunWith(Courgette.class)
@CourgetteOptions(
    threads = 10,
    runLevel = CourgetteRunLevel.SCENARIO,
    rerunFailedScenarios = true,
    showTestOutput = true,
    cucumberOptions = @CucumberOptions(
            features = "src/test/resources/features",
            glue = "steps",
            tags = {"@regression"},
            plugin = {
                    "pretty",
                    "json:target/courgette-report/courgette.json",
                    "html:target/courgette-report/courgette.html"}
    ))
    public class RegressionTestSuite {
    }
Ranjith's
  • 4,508
  • 5
  • 24
  • 40