-
Notifications
You must be signed in to change notification settings - Fork 152
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
v4: Create single constructor method/structure for a TestPackage #889
Comments
Decided I should do this before starting issue #909 spike! |
Great! This issue is the epitome of technical debt in my opinion. The number of times it's made something I've been trying to do harder! |
Thoughts on how to do this. I'd appreciate comments from @nunit/engine-team and others. We have two constructors because
Options considered...
Personally, I like the third option. Charlie |
I agree with the third option. Some other thoughts:
Whatever we settle on, definitely think we should get this documented! Something I'm still not sure about in the current codebase is what the structure of a TestPackage should or could be - which makes it very difficult to reason about! |
If we forget about fields and properties and just keep it to the conceptual level, a package is a collection of assemblies OR other packages, together with settings, which apply to contained packages unless overridden. If you consider it that way, then a package doesn't need a name unless we need to refer to it. I thought of making the subpackage class internal. But for test purposes, we often construct subpackages and then add them to a package. This might be something a calling program would want to do as well. It seems cleaner if everything is a I lean toward NamedPackage because it says what the thing is rather than how we use it. If someone wants to construct a tree entirely out of unnamed packages, we might not care. IMO the important thing is that they are constructed consistently. That said, maybe the naming should be based on what the package contains like AssemblyPackage, ProjectPackage. I can play with it a bit when I work on it (which will be after #913 merges). There's a reason why a package always has one subpackage. Conceptually, it's inherited from NUnit V2, where the command-line was always an NUnit project. That is, even if you entered a single assembly, what got was an unnamed project containing a single assembly. Same goes for NUnit3. If you enter an assembly you get a package with a single assembly subpackage in it plus settings derived from your command-line options. It's actually pretty powerful. I think the most important thing we have to do is to stop treating the two constructors differently. |
Should this be closed as #920 was merged? |
Yes, we don't get automatic closing on the 4.0 branch. |
This was merged to dev-4.0 and closed. I'm reopening it so as to replicate it in main. |
From memory, there are currently multiple constructors for a test package, which create different package sturctures which the agent must handle. We should reduce this to a single method.
The text was updated successfully, but these errors were encountered: