-
-
Notifications
You must be signed in to change notification settings - Fork 616
feat: support providing multiple paths #1611
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
Conversation
3d1786b to
cbf95ad
Compare
acoulton
left a comment
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.
@marmichalski this looks good to me, and very helpful, thanks.
I agree that it's probably not necessary to try and detect / warn about overlapping paths.
Only question is about the feature coverage - I think it would probably also be worth specifying behaviour when providing directories, and also when specifying specific scenarios e.g. features/feature1.feature:7? I had a quick look and I can't see existing features that cover these so it would be good to make sure we're not breaking anything.
I'd suggest restructuring from the current "everything in one .feature file" to the newer approach with a fixtures directory that @carlos-granados used in e.g. #1593 - that would make it easier to have more than 2 feature files in nested directories and reduce the verbosity of the setup in the .feature file itself.
Are you happy to take a look at that?
Yea, sure. I'll see what I can do |
This has been covered, also covered directories filtering.
I've had a look at what you are proposing here, but all of the scenarios in this file require quite the same setup - we assert that the features were executed only from properly filtered paths I am not sure if it's worth splitting them out to separate feature files? I believe this setup adds more confidence in the filtering too, eg when you provide |
|
@marmichalski thanks for this - it looks good to me. The test failures are due to #1635 - we'll get that figured out and then we will be able to see this green.
I probably wasn't very clear. I was suggesting that instead of the current "Given a file named ..." in the background, you would have those as actual files in a structure like: Then this feature would look more like: Background:
Given I set the working directory to the "PathFilters" fixtures folder
And I provide the following options for all behat invocations:
| option | value |
| --no-colors | |
| --f | pretty |
Scenario: First feature file only
When I run behat with the following additional options:
| option | value |
| features/a/feature1.feature | |This makes it easier to see the actual directory structure of the files in the fixtures directory. It also reduces the noise from the top of the feature and the "when I run behat" steps (things like the FeatureContext implementation, or the If you'd like to have a go at that that would be great, if not I'd be happy with this as-is and we can migrate it to the newer feature / fixtures approach in due course. |
Ah sorry! Added fixtures. The CI failure seems unrelated - the translations are different when you run the tests with latest dependencies 😢 |
carlos-granados
left a comment
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.
Overall the functionality seems correct and well tested, I just added a couple of small comments/questions
carlos-granados
left a comment
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.
Good job @marmichalski we'll let you know once we have been able to solve the failing test
acoulton
left a comment
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 merged master into this to pick up the gherkin fix and it's now green. The PR looks good to me, thanks @marmichalski :-)
carlos-granados
left a comment
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.
Looks good to me as well, thanks @marmichalski
Brings the history of the old abandoned 4.x branch into the current master, ahead of creating a new 4.x branch. This will avoid us losing the record of these contributions when we restart development for 4.0. There are only very limited changes - there was only one functional PR Behat#1397 that was merged into 4.x in 2023. The same feature was subsequently implemented by a different contributor in Behat#1611, merged into master and released in 3.23.0. The solutions are essentially identical except for a change to WrongPathsException which I have kept both because it is more correct and in case anyone is already using the 4.x branch.
Brings the history of the old abandoned 4.x branch into the current master, ahead of creating a new 4.x branch. This will avoid us losing the record of these contributions when we restart development for 4.0. There are only very limited changes - there was only one functional PR subsequently implemented by a different contributor in Behat#1611, merged into master and released in 3.23.0. The solutions are essentially identical except for a change to WrongPathsException which I have kept both because it is more correct and in case anyone is already using the 4.x branch.
Resolves #834.
This PR adds support for providing multiple paths to behat cli:
behat one.feature two.feature nested/features/There is a room for improvement to deduplicate the features, but I do not consider this a critical requirement, as this can be considered user error for now. The example of this would be:
behat features/a/one.feature features/a