-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Warn when feature / glue paths passed as file schemes #2547
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2547 +/- ##
============================================
+ Coverage 84.50% 84.53% +0.02%
- Complexity 2655 2661 +6
============================================
Files 310 310
Lines 9339 9356 +17
Branches 898 901 +3
============================================
+ Hits 7892 7909 +17
Misses 1115 1115
Partials 332 332
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That was quick!
Looks like we're going in the right direction over all but there are a few things to consider:
-
It is usually a good idea to keep the tests as close to the code under test as possible. There are dedicated unit tests in
FeaturePathTest
andGluePathTest
. Consider moving the tests there. -
I do think the
anyRecordMatch
method is pretty neat but I also think that after adding parameterized tests and fixing the root cause of the failure in theFeaturePathFeatureSupplierTest
it won't be needed anymore. If done right there should only be one log record per test case.
core/src/test/java/io/cucumber/core/runtime/FeaturePathFeatureSupplierTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/cucumber/core/logging/LogRecordListener.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/cucumber/core/options/CucumberOptionsAnnotationParserTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/cucumber/core/options/CucumberOptionsAnnotationParserTest.java
Outdated
Show resolved
Hide resolved
thanks for the feedback, changed accordingly (except for adding explanation about the feature path, because it does work as file scheme, so not sure what more to say) |
No problem. I'll think about the explanation a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're almost there now. Currently the regex patterns also match a few things they shouldn't match. Consider adding tests where nothing is logged.
Hint: You can pass matchers as an argument to the test method.
changed it. |
By returning immediately when a pre-condition doesn't hold we can reduce the nesting and make the code more readable.
If nothing is logged, lambda is not invoked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a few improvements to the GluePath
. Please let me know what you think about the explanation.
I still have to look at the FeaturePath
. Hopefully that will come later.
I prefer shorter explanations, that start with a short action "change |
That's a good idea.
If you can add an entry in the changelog under "Added" I think we're done. |
closing this? |
Will be soon. It's good! |
Hi @tal66, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
Hi, this closes #2543. changes: