-
Notifications
You must be signed in to change notification settings - Fork 153
Add new interfaces and enable use of launchers internally #1674
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
base: version4
Are you sure you want to change the base?
Conversation
@veleek I thought this wold be a good way for you to get familiar with the v3 vs v4 approach to launching agents. |
@veleek FYI I'm going to have a second commit on this. You can either wait for that or start reviewing the first commit, whichever seems convenient. |
@nunit/engine-team I've greatly increased the scope of issue #1673 so I've asked several of you to review this. Those not named are, of course, also welcome to review or comment. This is a key new feature and will put us very close to being able to release a beta. Whatever time you can give will be helpful. |
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 would like Process
to be abstracted, especially if you want to support InProcess
and RemoteProcess
agents. See further remarks embedded.
I assume that the existing AgentProcess
and AgentProcessTest
classes will be deleted once this is finished.
Not sure if we want to do #1660 first as this PR touches on cases where a different transport is used.
If you keep RemotingTransport should all that code be in the Net462Agent
as the only one using it.
src/NUnitEngine/nunit.engine/Services/AgentLaunchers/Net462AgentLauncher.cs
Outdated
Show resolved
Hide resolved
src/NUnitEngine/nunit.engine/Services/AgentLaunchers/Net80AgentLauncher.cs
Outdated
Show resolved
Hide resolved
src/NUnitEngine/nunit.engine/Services/AgentLaunchers/Net80AgentLauncher.cs
Outdated
Show resolved
Hide resolved
agentProcess.Exited += (sender, e) => OnAgentExit(agentProcess); | ||
|
||
agentProcess.Start(); |
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.
As discussed this should be abstracted into a LocalProcessAgent
return _agentStore.IsAgentProcessActive(agentId, out process); | ||
} | ||
|
||
private void OnAgentExit(Process process) |
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 handler should be in the LocalProcessAgent
Yes, I've been living with the tension created by GetAgent returning a Process, figuring I'd reconcile it at some point. I think this issue is the place to do it but it may be a commit or two away. |
@manfred-brands I made a few off-the-cuff comments. I'll come back to these for actual action in the next commit. |
@nunit/engine-team I've greatly increased the scope of issue #1673 so I've asked several of you to review this. Those not named are, of course, also welcome to review or comment. This is a key new feature and will put us very close to being able to release a beta. Whatever time you can give will be helpful. |
The second commit does two things:
The exception to the code changes is the proposal that we make the launcher interface be about agents, abstracting from processes. This is where I'd like to go but it's a big change, so I'll take a shot at it in I can see two ways to do this:
|
src/NUnitEngine/nunit.engine/Services/AgentLaunchers/AgentLauncherBase.cs
Outdated
Show resolved
Hide resolved
src/NUnitEngine/nunit.engine/Services/AgentLaunchers/AgentLauncherBase.cs
Outdated
Show resolved
Hide resolved
The third commit is mostly a major file reorganization. Launchers are moved to a separate project, which is how they will be when they are extensions. This creates some odd warnings due to incompatible references that are not actually used by the code. These will go away when I remove the launchers and agents. I renamed Made some other changes due to @veleek 's comments. |
I'm moving away from this PR for a bit in order to work on the two independent agent projects. Once they are set up, I'll be able to remove the agent code from this project and have it depend on the two agent packages. |
Fixes #1673
As explained in the issue, some of this is temporary, allowing us to use the same concept of a "launcher" for internal agents that will be used for pluggable agents. After all agents become pluggable extensions, the launcher code will disappear from the engine itself. The plan for transitioning is...