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

cucumber.properties missing support for threads value #2833

Open
boaty82 opened this issue Dec 14, 2023 · 4 comments
Open

cucumber.properties missing support for threads value #2833

boaty82 opened this issue Dec 14, 2023 · 4 comments
Labels
⚡ enhancement Request for new functionality

Comments

@boaty82
Copy link
Contributor

boaty82 commented Dec 14, 2023

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

@boaty82 boaty82 added the 🐛 bug Defect / Bug label Dec 14, 2023
@boaty82
Copy link
Contributor Author

boaty82 commented Dec 14, 2023

I can create a pull request if so desired as it is quite a simple change to do with the relevant tests too

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Dec 14, 2023

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?

@boaty82
Copy link
Contributor Author

boaty82 commented Dec 14, 2023

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

@mpkorstanje
Copy link
Contributor

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.

@mpkorstanje mpkorstanje added ⚡ enhancement Request for new functionality and removed 🐛 bug Defect / Bug labels Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

No branches or pull requests

2 participants