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
NUnit Planning #3325
Comments
I like everything you listed! I have some more thoughts about NUnit.Core but that deserves its own thread probably. What do you think about supporting either Would you envision not supporting .NET Standard or .NET Framework? .NET Standard's future is uncertain now that all .NET runtimes are unifying under .NET 5. |
At this point, I'm not committed to anything. I like the idea of committing to 4.7.2 or 4.8 longer term, but I think we need feedback from the community on what they are using and what they are starting new projects with. I like the idea of having just one target like .NET Standard that just works with 90% of what people are using these days, but like you said, the future of .NET Standard is up in the air. I don't think we should rush into anything and wait to see how everything pans out with .NET 5. That said, I do think there are technologies that we know we want to drop, so we can start planning for that with a bit stronger conviction. |
I think that two thngs should be clarified at the point this is announced...
|
Looking back at Rob's list, I see the first two items relate to the engine rather than the framework, so maybe this is a more global discussion than just the framework. BTW, I skipped the list of items to make my earlier comment... I'm pretty much in agreement with all of them. |
Good points @CharliePoole, I agree that both are important. For your second point, I am pretty sure that it will encompass the framework, engine, console and adapter, so it is something the entire @nunit/core-team will need to be involved in. |
Here are my thoughts:
I also think:
|
@ChrisMaddock Some thoughts on your thoughts... 😄
The main thing I'd add, which may only be a breaking change for third-party runners, is splitting up the engine into two layers as once discussed. |
Just come across a another point: review the Engine API, and make some tactical breaking changes, e.g.
|
Good idea. I was hoping this would be internal, but I guess we consider any repackaging changes
I guess this and 'inprocess' come hand in hand, really. Maybe inprocess really should go...
I don't believe the engine should hold any machine-specific-configuration, e.g. stored in locally saved files. If runners wish to use this, they should package their own solution. It's currently only used in the RecentFilesService, which is a sensible use...although in my opinion is a more of a runner-specific service than something that the engine should provide. I expect we might disagree on this one! Shall we move it to a separate thread, if we do? 🙂 |
Regarding settings, I understood you to mean that you would get rid of the entire file. I agree that the engine itself should not use settings. We did it that way in V2 but have been moving away from it. The current standard, as I understand it, is that runners retrieve any default or saved settings and then pass the equivalent package settings in a test package. The engine is supposed to only pay attention to what is in the package. I do think that providing a standard way to save and retrieve Settings for clients is a reasonable thing for the engine to do. That's what SettingsService does. Of course, it could be removed but then each client would need to define it's own way of storing settings. This isn't the only runner-oriented service the engine provides either. Recent Files and Filter parsing are two other services that the engine itself has no need of but provides to clients. |
Regarding RuntimeFramework determination... I noticed that problem in a recent issue as well. IIRC, we originally only selected the highest runtime for all assemblies run in the same process. It's possible that we broke that in making some other change. I think the logic of this was that the user, in telling us to run multiple assemblies in the same process, should expect them to all run under the same framework. We also do it for RunAsX86. However, if we are doing breaking changes, it may make sense for RuntimeFrameworkService to only deal with a single assembly and let the runner decide what to do about combining settings for multiple assemblies. |
One other change that we should probably make to the engine is to remove all of the code that searches for newer versions of the engine. It was a good idea to allow users to install a newer version of the engine and override what was shipped with a runner, but we never got buy-in from the people that wrote runners, it was buggy and hard to diagnose problems when you couldn't tell which engine people were using AND we ended up turning it off by default around v3.4. In the framework, I'd also really like to trim down or maybe remove the PlatformAttribute. At the very least, I think the values should be Enum flags, not strings so they are discoverable. .NET Core opens up so many operating systems that we will never keep up. Similarly, we are way out of date on our Runtime support. Interestingly, nobody is asking for support for the newer OS's or Runtimes, so I expect it isn't used. The only thing that may still be useful are the Architecture flags, but those could be done with an |
I would like to see some of the JUnit 4 features make it over to .NET. There is a Rule framework that makes setting up test sequences and global context easier. |
Regarding Partial Trust, I've noticed another conflict it can cause on .NET Framework when dealing with spans. APIs such as |
Hi, |
@z002Holpp NUnit 4 is still a ways out. It is more an idea at this point than a product. |
@rprouse If we're still considering ideas, a few things I'd like to suggest:
|
I second that. When moving from NUnit2 to NUnit3 we noticed that test got slower. Less of an issue when there are few asserts, but some of our projects assert values in a loop. Those test got significantly slower. We had to create a LightWeightAssert wrapper with explicit
Every time there is an NUnit3 reads great with the new fluent like api, but it came as a cost. |
I agree with @stevenaw about Generics... I've tried twiice to do an extensive rewrite based on generics, but I couldn't do it without introducing breaking changes. I'm fairly sure it can only be done in a rewrite that breaks things... i.e. a major release. If @rprouse 's intent is to continue with infrequent major releases, then it may be best to focus mostly on the breaking changes and make other improvements in 4.1, 4.2, etc. I suspect the change from async over sync to native async requires the same sort of approach, although I have never tried it. Buffering or not buffering doesn't seem like a breaking change provided the API is able to support it... e.g. through a newly introduced package setting. So that seems less urgent to get defined for a 4.0 release. Minor correction for @manfred-brands... the fluent api wasn't new in 3.0. It was introduced in 2.4 in 2007. So any performance loss was probably already present but unnoticed. It's possible that fixing it could be a simple implementation detail since it doesn't change (in my opinion, anyway) a public/published API. |
I also tried a generics rewrite before we released 3.0 but it ended up going so deep and touching so much that I gave up. Even though it is a major release, I'd still like to keep breaking changes to a minimum. Even small changes like removing That said, I think that many of our asserts could have generic versions in a non-breaking manner and if someone wants to take another try, power to you 😄 |
I think I recall reading a comment a while back from still another team member (@jnm2 ?) about an attempt to make the constraints generic. Seems like a popular ideal to work towards :D I like the idea of minimizing friction between upgrades too. Perhaps it's something which could be tackled piece-by-piece in a non-breaking way, as you suggested. In any case, I'd also like to avoid changes which require wholesale updating of written + working tests by people. Ideally, a generics-based version should "just work"
Hm, thanks @CharliePoole . For some reason I had thought
I agree with both @CharliePoole and @manfred-brands here. I like the idea of trying to improve memory consumption in the framework but I think the fluent API concern here is just an implementation detail. There's likely some internal things we can do to cache or pool comparers. For example, I would guess that the large majority of assertions are made against primitives like |
Although I have seen it, I'm not a fan of mixing classic and new asserts in a single file, it should be one or the other. Having said that, @CharliePoole I think I had replaced most usages of classic asserts in our test project, except where testing those. To be sure we should also move those tests to a Classic.Test project so that our main library and test doesn't reference the classic project. |
I am not really looking at mixing them the way I showed above. More to point out that the Test attribute is in the NUNit.Framework namespace, and that will collide when the Classic asserts are added. We could create new perhaps derived attribute classes, but I am not sure if that is worth the effort. @CharliePoole @manfred-brands Please also see PR #4417 where I have started moving the classic asserts over to a new project. @charlie Interesting thoughts. First I think it would be nice to clean the project, separate these two, and also get rid of the params ones. Clean up namespaces, getting the tests organized. Right now I feel I am wading in an ocean of code... Guess that is what we get after 20 or so years :-) |
@CharliePoole In the PR I have tried to do exactly that. It seems to have been done efforts for this earlier (@manfred-brands ?) but I did find a few places where that was done. In addition, as mentioned above, a few places which used both. |
@manfred-brands @stevenaw @jnm2 Are you able to test the Issue4416 branch inside Visual Studio? I get testhost issues, but am on a vacation laptop so might be missing something. |
Thanks for putting the PR together @OsirisTerje ! |
@OsirisTerje @stevenaw I got back from holiday myself just last night.
Visual Studio tries to find test in any assembly loaded in the solution, even if running them in one project only.
There is an issue in VSTest which sort of blames it on us: We explicitly add The actual VSTest issue referenced above says it occurs on project including I have seen errors in the past where our NUnitExtension projects get errors as they do not include |
I found some "documentation" about ProjectCapabilities. It says: |
Thanks @manfred-brands ! We need to figure out how to mark a net462 project as not-testable. |
The vstest issue linked above mention properties that might need setting: |
Yes, just did that, and after a reload of VS they disappeared :-) Adding IsTestProject=false to the indirect test projects, |
@OsirisTerje I think we should close this one (and also remove it as pinned at the top of the issues) |
@mikkelbu @nunit/framework-team This is really a very long discussion of things that should be considered for future versions, some of them have been handled in 4.0, but there are still more. So, perhaps better to transfer this to Discussions and change the name to |
To jump in with a suggestion: milestones in GitHub may be useful here. Each item can be turned into an idea and labeled with a "future planning" milestone. Then when planning a release, a milestone can be created for the release and items can be associated with it. Thus we see the progress towards the release and which items have been defined for a "future" bucket that we can pick from. Could also be a handy way to triage feature requests and write up how we'd approach them. I'm not really a contributor to this repo (though I hope to change that at some point!), but wanted to offer the suggestion as I've seen it work nicely before. |
Good point! Make sense to me. |
Suggestion: If there are desirable breaking changes that were missed in V4, create a milestone to hold them. Hinit: The framework API for .NET framework is different from .NET Core and IMO should be obsoleted. :-) |
You mean anything that has to do with Tread Abort: e.g. Timeout ? |
@manfred-brands I mean the code in NUnit.Framework.Api namespace, primarily FrameworkController. I originally implemented it, using |
I also like @SeanKilleen suggestion. Then we just need to go through the 78 comments and extract the information :). I'll make a TODO for it. |
@mikkelbu FYI I've just made a "Future Planning" milestone: https://github.com/nunit/nunit/milestone/47 |
#3301 brings up the fact that Partial Trust is no longer supported in .NET Core and conflicts with
HandleProcessCorruptedStateExceptions
in the full framework. This and other changes make me think that we might want to start thinking about the next version of NUnit. .NET development has changed dramatically since @CharliePoole started working on NUnit 3 and even since the first full release of NUnit 3. It might be time to start thinking about what NUnit 4 will be.My initial thoughts are to evolve in the direction that .NET is going with a .NET Core / .NET 5 only version and continue to maintain and release bug fixes only for NUnit 3 for the next few years for people that are still using the earlier versions of .NET Core or the full framework. This is very much off the top of my head and plans will change, but I'd like to get the discussion going.
Some of my thoughts,
nunit.core
with concrete types for all the messages that are passed via XML currentlyI'm sure there is a lot more out there, but this should get the discussion started 😈
The text was updated successfully, but these errors were encountered: