cucumber-jvm
cucumber-jvm copied to clipboard
cucumber.properties missing support for threads value
io.cucumber.core.options.CucumberPropertiesParser pulls in many of the required arguments from various sources e.g. a properties file, environment or system properties
However, it appears to not be looking for number of threads to use (--threads via CLI) - was this intentional?
👓 What did you see?
Having setup multiple scenarios, and having added cucumber.execution.threads=2 to properties file I expected tests to run in parallel
✅ What did you expect to see?
cucumber.execution.threads should be parsed and utilised
📦 Which tool/library version are you using?
cucumber-core 7.14.1
🔬 How could we reproduce it?
Create multiple scenarios
Create cucumber.properties with the normal required values (e.g. glue, features and plugin)
Ensure within the properties file you add cucumber.exeution.threads=2
Run cucumber
You will see all tests are executed synchronously and the timeline report also confirms this
I can create a pull request if so desired as it is quite a simple change to do with the relevant tests too
Having setup multiple scenarios, and having added cucumber.execution.threads=2 to properties file I expected tests to run in parallel
I think there is a mismatched expectation here.
The --threads option is only supported when running Cucumber through the CLI. The JUnit 4, JUnit 5, TestNG modules each do parallel execution differently. It only is a historical accident the that the CLI is included in the core module.
So I'm not sure what a cucumber.execution.threads property would accomplish. Besides making people wonder why it doesn't make their tests run in parallel when not using the CLI.
Could you elaborate on the benefit of using the property over the CLI option?
by having the properties file support it, then running via gradle and other build systems you can merely use cucumber.properties - whereas if you want to use this then you also have to put some stuff into CLI args
would be nice to use one of the other, and I know you can purely use CLI, but it just seems nicer to have this in properties files as then in spring boot you can use profile property files too
but as you state, and I did not consider, TestNG and others it would then be confusing
Okay that sounds reasonable. Please do feel free to send a pull request. The documentation should include a note that the property is only used by the CLI. Do note that the documentation for properties is duplicated in a few places.