Automatically tag scenario depending on their steps #915
Replies: 2 comments 5 replies
-
|
Would it be possible to share more detail of your implementation? I'm not sure I'm understanding clearly the objective. What indicators are you examining within a Scenario to identify those that need this tag? If you can share the plug-in implementation, I can take a look and provide feedback. |
Beta Was this translation helpful? Give feedback.
-
|
It looks like you've already got the answers you're looking for, but I wondered if the problem might be down to not preserving |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I currently have a use case where the best way to maintain my test suite (~7000 tests all split up between multiple projects) and some of those tests require pre-conditions to ensure they are ready to run.
An example to show the use case: we are using MockServer for our UI tests but only about 400 of them need this case and they require setting some default headers for only those cases. Across my team it's very easy to just forget adding that @mockserver tag on a random test and then it'd fail. We elected to make our own extension project to hook into the MSBuild target after Reqnroll generates the *.feature.cs files so we can add the Category attributes after parsing them out. The code was functional but dense and it seems to have broken recently when attempting to update from 2.0.3 to 3.2.0. Instead of trying to maintain that pattern, I was electing to try and follow Reqnroll patterns by making a generator plugin.
Ultimately I used the pattern on the ExternalData plugin to guide me and was successful on the pattern, but the performance is... lacking. A build that takes 30-40 seconds without the plugin now takes about 4 to 5 minutes. I'm not too familiar with the ins and outs of Reqnroll plugins and where the best spot to do my checks and modifications would be, so I'm looking for advice here. Admittedly, it makes sense that it's slow because the pattern on the ExternalData plugin is to let the parsing happen normally for getting the ReqnrollDocument instance, but then it more-or-less loops through all documents/features/scenarios/rules to check for qualifying steps and marks them accordingly by recreating the Scenario or ScenarioOutline with the tags concatenated. When doing some time tracking, it seems like the normal parsing is taking about 0.0001 - 0.0002 seconds per document and then the iterative pattern with adjustments can take anywhere from .05 - 1+ seconds per document.
Is there a recommendation to dive deeper into overriding the parser as a way to avoid the 2nd pass on the documents, or am I too low already and this would be better higher up? I tried overriding the NUnit generator implementation with this logic and that was pretty fast but ultimately only added the category attribute without adjusting anything else so that had a mismatch between NUnit and Reqnroll since the generated code that passes in the tags into the scenario creation methods never got adjusted.
I need some good resolution if I'm gonna be able to update and I'd really like to update if possible. Open to ideas here.
Beta Was this translation helpful? Give feedback.
All reactions