-
Notifications
You must be signed in to change notification settings - Fork 248
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
Skip features that are not selected by tags: i.e. logs and test life cycle (befores/afters) #196
Comments
I noticed it also executes the before and after methods for any FeatureContext. I'd expect that those points in the life cycle would be skipped because of the tag filter. |
I'm going deeper in the godog code to understand the lifecycle, and maybe I'm wrong: how the I used Then I have this question: how many FeatureContext functions are recommended by project? I'd imagine one per module, contributing life cycle methods to the test runner. Then, this runner would select what to run depending on the flags/tags. I'd love any guidance here 🙏 |
Hey @l3pp4rd , any feedback here? 🙏 |
In the project I use godog we have different pieces/modules under the same project layout. Each of them is contributing a different set of steps in the form of a What I observe running I created this same repo reproducing the same behaviour: https://github.com/mdelapenya/sample-godog |
Heya @mdelapenya thanks so much for passing along so much info! I'll take a look and see what I can find. Godog's been going through a lot of changes recently and there's definitely more that need to happen. As a heads up, l3pp4rd is heads down on other work unrelated to godog. Right now there's not many super active folks, so please bear with us, especially given the crazy time in the world right now. If you've got the cycles and are up for submitting a PR, by all means I welcome it! |
Thanks @jaysonesmith for the feedback! I've been reading the source code of the builder and, with my current knowledge of the codebase, I see it complex to couple the life cycle of the tags with the feature contexts defining the steps supporting that tag: the godog test binary inspects the exported contexts without taking runtime tags into consideration (i.e. this tag applies to these scenario/example). On the other hand, I have a test demonstrating this behavior in the If too complex, I'd consider having different subprojects (different go.mod files) per submodule, as in the _examples dir, but with some guidance I could make progress on a feature/fix |
What do you think, should we handle empty feature files in the same way? |
Adding context to this: I moved the project layout to a more standard one, so each feature context is under one test project. Therefore is a responsibility of the build system or the CI to run one or the other. Thanks for your feedback here! |
I noticed that Godog always prints all the features present in the project, although they are filtered by Cucumber tags
As an example:
I'd like to omit those features not selected to be run
The text was updated successfully, but these errors were encountered: