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] Parse rerun file in RuntimeOptions #1529

Merged
merged 2 commits into from
Jan 5, 2019

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Jan 4, 2019

Summary

Cucumber runs features on the feature path. The feature path can consist
of features, features with line filters or a rerun file containing
features with line filters.

The current implementation would pass the rerun file inwards as if
it were another feature file. The FeatureLoader would then deal with it.

This behavior is undesirable for two reasons:

  1. It comes as a surprise that the FeatureLoader also parses rerun
    files.
  2. It comes as a surprise that the Filters also parses rerun files.
  3. The rerun file and syntax are part of the command line runner. Other
    runners have different methods to rerun their own tests. As such it
    should be contained in RuntimeOptions and not leak into other parts
    of the core.

Moving rerun file parsing into CucumberOptions now allows the following
to be done:

  1. Focus the the FeatureLoader on loading features only
  2. Consolidate parsing resources in to GherkinFeatures and compiling
    GherkinFeature into pickles in a single FeatureParser that now
    produces a ready to use CucumberFeature object.
  3. Reduce the responsibility of the FeatureBuilder to building a list of
    features.
  4. Remove the responsibility of dealing with rerun files from the
    JUnit and TestNG runner.

Additionally we can now emit a proper error when a feature file is explicitly referenced but does not exist i.e:

@RunWith(Cucumber.class)
@CucumberOptions(features = {"classpath:path/to/absent/file.feature"})
public class RunCukesTest {
}

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 force-pushed the master branch 2 times, most recently from 59a2874 to eb1a90b Compare January 4, 2019 18:12
@mpkorstanje mpkorstanje force-pushed the parse-rerun-files-in-runtime-options branch from 5b77428 to 6ac4ee1 Compare January 4, 2019 18:14
@coveralls
Copy link

coveralls commented Jan 4, 2019

Coverage Status

Coverage increased (+0.3%) to 86.114% when pulling 4da7fc1 on parse-rerun-files-in-runtime-options into eb1a90b on master.

Cucumber runs features on the feature path. The feature path can consist
of features, features with line filters or a rerun file containing
features with line filters.

The current implementation would pass the rerun file onwards as if
it were another feature file. The FeatureLoader would then deal with it.

This behaviour is undesirable for two reasons:

1. It comes as a surprise that the FeatureLoader also parses rerun
   files.
2. It comes as a surprise that the Filters also parses rerun files.
3. The rerun file and syntax are part of the command line runner. Other
   runners have different methods to rerun their own tests. As such it
   should be contained in RuntimeOptions and not leak into other parts
   of the core.

Moving rerun file parsing into CucumberOptions now allows the following
to be done:

1. Focus the the FeatureLoader on loading features only
2. Consolidate parsing resources in to GherkinFeatures and compiling
   GherkinFeature into pickles in a single FeatureParser that now
   produces a ready to use CucumberFeature object.
3. Reduce the responsibility of the FeatureBuilder to building a list of
   features.
@mpkorstanje mpkorstanje force-pushed the parse-rerun-files-in-runtime-options branch from 6ac4ee1 to e70f023 Compare January 4, 2019 18:36
@mpkorstanje mpkorstanje merged commit abe94d9 into master Jan 5, 2019
@mpkorstanje mpkorstanje deleted the parse-rerun-files-in-runtime-options branch January 5, 2019 01:34
@lock
Copy link

lock bot commented Jan 5, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants