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

[Core] Add property based runtime options #1741

Merged
merged 7 commits into from
Sep 5, 2019
Merged

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Aug 18, 2019

Summary

Adds properties for all CLI options. Removes the ability to load rerun files from the class-path. There appears to be no use case and it significantly simplifies the implementation.

Details

Adds:

cucumber.ansi-colors.disabled
cucumber.execution.dry-run
cucumber.execution.limit
cucumber.execution.order
cucumber.execution.strict
cucumber.execution.wip
cucumber.feature
cucumber.rerun-file
cucumber.filter.name
cucumber.filter.tags
cucumber.glue
cucumber.object-factory
cucumber.plugin
cucumber.snippet-type

Motivation and Context

It is possible to pass properties to cucumber using CLI arguments in a property. E.g.

mvn clean test -Dcucumber.options="--strict --monochrome"

This is rather complicate, esp when multiple layers are involved and quotes get confusing (e.x: #1596).

mvn clean test -Dcucumber.options='--strict --monochrome --tags "not @ignored"'

A better way to do this would be to provide each option individually:

mvn clean test -Dcucumber.strict=true -Dcucumber.ansi-colors.disabled=true -Dcucumber.filter.tags="not @ignored"

Closes #1675

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@mpkorstanje mpkorstanje added this to the 5.0.0 milestone Aug 18, 2019
@coveralls
Copy link

coveralls commented Aug 18, 2019

Coverage Status

Coverage decreased (-0.04%) to 87.979% when pulling 43a2fc7 on add-properties into 70c1c53 on master.

@mpkorstanje mpkorstanje marked this pull request as ready for review August 22, 2019 16:36
@mpkorstanje mpkorstanje merged commit c6b1a3d into master Sep 5, 2019
@mpkorstanje mpkorstanje changed the title [Core] Add property based variant for each runtime option [Core] Add property based runtime options Sep 5, 2019
@mpkorstanje mpkorstanje deleted the add-properties branch September 5, 2019 20:19
mpkorstanje added a commit that referenced this pull request Dec 6, 2019
Currently cucumber.options is used to control cucumbers execution when run
through mvn test. This is no longer required with the introduction of property
based runtime options in #1741.

Part of #1779
mpkorstanje added a commit that referenced this pull request Dec 6, 2019
Currently cucumber.options is used to control cucumbers execution when run
through mvn test. This is no longer required with the introduction of property
based runtime options in #1741.

Part of #1779
mpkorstanje added a commit that referenced this pull request Dec 6, 2019
Currently cucumber.options is used to control cucumbers execution when run
through mvn test. This is no longer required with the introduction of property
based runtime options in #1741.

Part of #1779
mpkorstanje added a commit that referenced this pull request Apr 23, 2020
`cucumber.options` was used to control cucumbers execution when run through `mvn test`. This is no longer required with the introduction of property based runtime options in #1741. Removing `cucumber.options` allows CLI argument parsing to be separated from property parsing which simplifies the complexity of parsing significantly.

Additionally
 - We remove `--add-plugin` and associated logic in `RuntimeOptionsBuilder`. All plugins are added by default.
 - Separate calling `System.exit` from parsing the runtime options. Main should check if exit is required after parsing.
 - Write tests that validate if the correct text is written to `System.out` and `System.err` by injecting these into `CommandlineOptionsParser`.

Fixes: #1779
@salunkhe-ravi
Copy link

salunkhe-ravi commented Sep 15, 2020

For some reason "mvn clean test -Dcucumber.execution.limit=1" doesn't work for me...
Can anyone share me some examples and/or usage documentation please?

@mpkorstanje
Copy link
Contributor Author

Not all runners support all options. Limit is only supported by the CLI.

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 this pull request may close these issues.

Provide a property name variant for each runtime option
3 participants