Skip to content
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

Internal inconsistency in NUnitTestAssemblyRunner #4596

Open
CharliePoole opened this issue Jan 10, 2024 · 0 comments
Open

Internal inconsistency in NUnitTestAssemblyRunner #4596

CharliePoole opened this issue Jan 10, 2024 · 0 comments

Comments

@CharliePoole
Copy link
Contributor

This is more of a potential source of confusion and of bugs rather than an actual bug. I found it only by inspection while helping some users of NUnit understand how the framework works but I have not built and tested it.

The method TestAssemblyRUnner.StartRun takes an ITestListener as its third parameter. If the special boolean setting FrameworkPackageSettings.SynchronousEvents is set, the argument is ignored. If it is not set, then an EventPump is created and TestExecutionContext.TestListener is set to it.

Failing to use the argument doesn't cause a problem because the same listener passed in has already been set in the context at the point of call. I'm fairly confident of this even though I haven't tested it, since the methods involved are private.

I feel that this would be a source of confusion for anyone not familiar with the history, i.e. why we created that setting in the first place. Obviously, the TestAdapter relies on it as does the Microsoft Test Explorer.

I suggest removing the parameter and simply using the listener passed in the context when creating the EventPump. That would make it much clearer what is going on and why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants