-
Notifications
You must be signed in to change notification settings - Fork 153
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
Only allow one runner at a time per connection to the agent by the protocol design #773
Changes from all commits
be1a035
2ae5d66
7c06235
8769abc
da4351c
645a8a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,18 +24,53 @@ | |
namespace NUnit.Engine | ||
{ | ||
/// <summary> | ||
/// The ITestAgent interface is implemented by remote test agents. | ||
/// Defines the current communication protocol between the engine and the agent. This is an implementation detail | ||
/// which is in the process of changing as the dependency on .NET Framework's remoting is removed. | ||
/// </summary> | ||
public interface ITestAgent | ||
{ | ||
/// <summary> | ||
/// Stops the agent, releasing any resources | ||
/// </summary> | ||
void Stop(); | ||
void ShutDown(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Others may not be confused, but I guess I find it confusing to see an interface that implements |
||
|
||
/// <summary> | ||
/// Creates a test runner | ||
/// Loads a package which will be used for all subsequent calls to the other methods (except | ||
/// <see cref="ShutDown"/>). This method must be called at least once before calling methods that operate on a | ||
/// test package. It may be called any number of times after those methods. | ||
/// </summary> | ||
ITestEngineRunner CreateRunner(TestPackage package); | ||
TestEngineResult Load(TestPackage package); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reading this, I feel the need to read all the code so as to see if all the methods of |
||
|
||
/// <summary> | ||
/// Unloads any loaded package. If none is loaded, the call is ignored. | ||
/// </summary> | ||
void Unload(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I expect your working on a minimal-change-basis here, but before we move on from this project entirely, I think we should consider if ignoring an empty Unload call rather than throwing is the behaviour we want here. It feels inconsistent with Reload's behaviour below... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ChrisMaddock It could have been different, but it's public behavior. I don't think we should change what has been a safe call into one that throws. UPDATE: Might not be public in this particular interface, but it is what we do in |
||
|
||
/// <summary> | ||
/// Reloads the loaded package. | ||
/// </summary> | ||
/// <exception cref="InvalidOperationException">Thrown if no package is loaded.</exception> | ||
TestEngineResult Reload(); | ||
|
||
/// <summary> | ||
/// Counts the test cases in the loaded package that would be run under the specified filter. | ||
/// </summary> | ||
int CountTestCases(TestFilter filter); | ||
|
||
/// <summary> | ||
/// Runs the tests in the loaded package. The listener interface is notified as the run progresses. | ||
/// </summary> | ||
TestEngineResult Run(ITestEventListener listener, TestFilter filter); | ||
|
||
/// <summary> | ||
/// Cancel the current test run. If no test is running, the call is ignored. | ||
/// </summary> | ||
/// <param name="force">Indicates whether tests that have not completed should be killed.</param> | ||
void StopRun(bool force); | ||
|
||
/// <summary> | ||
/// Returns information about the test cases in the loaded package that would be run under the specified filter. | ||
/// </summary> | ||
TestEngineResult Explore(TestFilter filter); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#if NET20 | ||
|
||
namespace System | ||
{ | ||
// This would cause conflicts if it was public in the API assembly. This is an engine implementation detail since | ||
// even though it's public because this assembly should not be compiled against by anyone that references the | ||
// engine. | ||
public delegate TResult Func<TResult>(); | ||
} | ||
|
||
#endif |
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.
Agents used
Stop
to indicate a distinction withShutDown
, which has a special meaning for Services. Services youseStartUp
andShutDown
, whereas communications elements have usedStart
andStop
. Where a comm element is also a service,Start
andStop
are typically called as part ofStartUp
andShutDown
. Having these as separate methods makes some unit-testing easier.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.
I will say, I've never been aware of that design intent! 😅
I have no strong opinion on the final naming. Joseph - re: Charlie's comment about unit testing, do you think that will cause an issue, based on your final goal here?
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.
@ChrisMaddock Well, to put it differently, the intent is seen in the definition of
IService
, which hasStartUp
andShutdown
methods. There is no rule against using the same method names outside of the interface, but it's potentially confusing... or maybe only confusing to me. 😄