-
Notifications
You must be signed in to change notification settings - Fork 44
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
MsTest: Replace DelayedFixtureTearDown special case with ClassCleanupBehavior.EndOfClass #128
Conversation
@obligaron Could you please split this PR into two (based on the two commits)? The |
@gasparnagy I removed the second commit and adjusted the first commit to have the same I would like to continue working on how the My understanding:
My idea:
What do you think? |
@obligaron Your proposed solution is more or less what I was also thinking about (that is the option 1) in https://github.com/orgs/reqnroll/discussions/124#discussioncomment-9420376. But I don't think we came to a consensus there whether that should be the way to go, so I would wait with that a bit. But if you have a bit of time to help, you can take the #123, which is also needed for the full solution anyway. That problem starts at https://github.com/reqnroll/Reqnroll/blob/main/Reqnroll/TestRunnerManager.cs#L103, where we pick one of the TestRunners in order to run the AfterTestRun hooks but does not dispose the others. Instead of that, we should dispose all the existing runners (i.e. dispose their container) and create a new one to run the AfterTestRun hook. |
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.
This is good. One additional thing we would need is to change the MsTest dependency version in https://github.com/reqnroll/Reqnroll/blob/main/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.nuspec as well.
…Behavior.EndOfClass
At least for me, I thought we were mixing up two related but independent topics in the discussion. Who starts
I can have a look at this later. 🙂 |
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.
thx
…ons-dependencyinjection-plugin * origin/main: (21 commits) Fix #56 autofac ambiguous stepdef and hook required #127 issue (#139) Reduce target framework of Reqnroll to netstandard2.0 (#130) Fix StackOverflowException when using [StepArgumentTransformation] with same input and output type (#136) MsTest: Replace DelayedFixtureTearDown special case with ClassCleanupBehavior.EndOfClass (#128) Temporarily disabled tests until #132 is resolved Add NUnit & xUnit core tests to portability suite Capture ExecutionContext after every binding invoke (#126) small improvement in CodeDomHelper to be able to chain async calls fix method name sources in UnitTestFeatureGenerator External data plugin, support for JSON files (#118) UnitTests: Check if SDK version is installed and if not ignore the test (#109) Fix 111 ignore attr not inherited from rule (#113) Update README.md (#110) Fix 81 - modified CucumberExpressionParameterTypeRegistry to handle multiple custom types used as cucumber expressions when those types share the same short name. (#104) Update index.md Simplify test project targets (#105) Make SystemTests temp folder configurable and use NUGET_PACKAGES env var to override global NuGet folder Fleshing out Generation System Tests (2) (#99) Fix for 81 - Cucumber Expression using Enums errors when two enums exist with the same short name (#100) Include BoDi to Reqnroll package (#91) (#95) ... # Conflicts: # Reqnroll.sln # Tests/Reqnroll.PluginTests/Reqnroll.PluginTests.csproj
This PR removes the special
DelayedFixtureTearDown
for MsTest. The workaround was used to ensure thatAfterFeature
was called after all scenarios of a feature had been called.This is now replaced by
ClassCleanupBehavior.EndOfClass
. This required a MsTest version of at least 2.2.8 (released end of 2021).Rationale:
ClassInitialize
hook running on the same thread (sameManagedThreadId
). But this is not guaranteed by the framework and is likely to change with MsTest V4.0 (switch to async pattern internally).Types of changes
Checklist: