Rod Borchevskyi
Rod Borchevskyi

Reputation: 443

Can I run karate in parallel using standalone JAR?

I am trying to run a simple test against a number of cases. I am using VS Code on Windows with Karate extension and standalone karate.jar.

Here is my feature:

Feature: settings support paths

Background:
* def some_ids = read('some_ids.json')

Scenario Outline: migrated settings are OK
    Given url 'https://someapi.myorg.net/settings/'
    And path id, 'Settings/Blah'
    When method get
    Then status 200
    And match response.settings !contains { DefaultCounty: '#number'}

Examples:
    |some_ids|

The Json is something like

[
    { "id":"0023a832-c1f3-464e-9de7-ce2cd0e24413"},
    // ... 300 more lines of ids
    { "id":"fff5a55e-e3a1-43d8-81ef-b590f388fe90"}
]

It all works well until the number of cases gets around 300 where it kind of freezes by the end of execution and never produces the summary in console.

With lower numbers it works just fine, and the summary always indicates threads: 1, which is also supported by elapsed time given that API responds in ~1 sec.

My question is, setting the freezing aside, can I run these tests in parallel using standalone JAR?

The doc says Karate can run 'examples' in parallel, but I did not find any specific instructions for standalone jar.

I am not using Java as main platform and have no experience with Java ecosystem to speak of, so ability to use Karate as standalone is a big win for me.

Upvotes: 1

Views: 582

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

Yes, just add a -T option: https://github.com/intuit/karate/tree/master/karate-netty#parallel-execution

java -jar karate.jar -T 5 src/features

Upvotes: 1

Related Questions