Filter/Run/Generate tests only for given tag #573
Closed
wgala-tomra
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
This might be possible as a plug-in. Take a look at the External Data plugin as an example. It overrides the default generator by modifying the Gherkin AST (it adds rows to Example Tables using data from external files). In your situation you might be able to surgically remove scenario nodes from the AST before code generation gets underway. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I was trying to incorporate reqnroll project into our own code base. We have few applications that are serving as whole product but generally are interconnected.
Also, we have many scenarios already created for whole product. Now, here's a catch, not all scenarios apply for given stack. What's more, not all scenarios are going to be covered by tests right away. Probably quite standard problem that many of us face.
My idea of using reqnroll would be to create test project for each stack. Each stack would have each own tag that would tell: "hey I implemented that scenario, all steps should be available, run that test here".
The problem I face is that the only way to do that is to use 'dotnet test filter' with given tag. We use VisualStudio and Test Explorer to run tests locally. All scenarios, are available there right away, no matter if tagged or not. Or whether it is implemented or not. My preferred outcome would be that only 'tagged properly' scenarios are available there (even if not implemented).
I don't want to put extra effort on team to run that command to check if scenario passes. Also, I don't feel it's robust enough that many tests are skipped and I am not sure if that's good thing, when going through test explorer. We do use 'dotnet test' for running unit tests when we build application, but that's already when changes are merged to main branch, which is too late and not good practice.
I went through documentation, I tried to create plugins to solve it and finally reached repository code where (from what I've seen) it's not possible to do that at this moment.
Could anybody tell me if that's supported, or in plans to support?
From what I've seen best way would be to expose it in generator section of reqnroll.json, so tests are not generated at all if doesn't fit tag criteria. Reason why I say this is that TestExplorer is quite greedy when it comes to test discovery and doesn't have option of filtering (that could be configured from csproj project file level)
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions