-
Notifications
You must be signed in to change notification settings - Fork 253
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
Please document the IPC handshake mechanisms and open up the classes under Microsoft.Testing.Platform.IPC
#2539
Comments
You should not use the named pipe directly, at the moment the IPC namespace is used internally for quick communication between processes to support out-of-process extension for instance codecoverage or hang dump, where the platform will restart itself under "observation" by the out out of process extensions. i.e.
The current internal pipeline infra is also used to have a "structured" communication between the msbuild node and the test application when we run under "dotnet test" using the current msbuild infrastructure and shipped in https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild The
This is the reason why the option starts with At the moment we have a "draft" for the json/tcp protocol and the implementation is built-in inside the platform and it's enabled using the |
How will the replacement And please don't forget that I am interested in being the test runner as well. I would like |
Nuget package https://nuget.info/packages/Microsoft.Testing.Platform.MSBuild ships a MSBuild task/props/targets that integrates with the "current" I would not take any dependency at the moment on IPC for The only current "draft" for a public protocol we have at the moment is the TCP/json-rpc one used by VS/VS-Code, but it's not complete enough to support all the features we need to have a "perfect" |
Okay, sounds like I should just wait until things are documented and public classes are available for both sides of the IPC mechanism. |
Do you have a timeline for when this will be usable? |
I'll let you know soon cc: @pavelhorak @Evangelink |
We don't plan for the moment to expose an IPC public protocol if you want you can experiment with the current tcp/json "draft" we have published that is supported in VS/VS-Code in preview for which we don't have yet an ETA to release as stable. |
Then is your only supported usage model via the (currently closed source) VSTest adapter? |
Also, is this the latest documentation? Or is there something newer? There are clearly nowhere near enough details in this one document to implement this without decompiling your implementation(s). |
For what I know yes but I'm not the owner of this part so I'll @drognanar to drive you there. @drognanar can you help @bradwilson with the current protocol draft? |
Ping @drognanar |
1 similar comment
Ping @drognanar |
We currently have not exposed ObjectModel the way that we did for TPv2, so if you are not planning on using the TestApplication API, you'd need to create your own JSON-RPC server and parse the messages as specified in the document. VS startup specifies the following flags: The code that implements the VS -> test runner server mode is implemented around the following classes:
|
You can also use System.Text.Json and vs-streamjsonrpc and avoid some of the boilerplate that we have, however in order to support native-aot and in order to support a platform that has no dependencies on other nuget packages, we had to make these utility classes ourselves. |
@drognanar @MarcoRossignoli Is this statement still true? I'm working against 1.3.1 and I still see MSBuild passing For the record, my delineation in my newly injected entrypoint looks like this: [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class AutoGeneratedEntryPoint
{
public static int Main(string[] args)
{
if (args.Length > 0 && (args[0] == "--internal-msbuild-node" || args[0] == "--server"))
return global::Xunit.Runner.TestingPlatform.TestPlatformTestFramework.RunAsync(args).GetAwaiter().GetResult();
else
return global::Xunit.Runner.InProc.SystemConsole.ConsoleRunner.Run(args).GetAwaiter().GetResult();
}
} Does this seem correct to you? (The TestPlatformTestFramework class is xUnit.net code that sets up the |
Also, do I need to add any other packages to make sure both |
How can I verify whether Test Explorer is using the TPLv2 or TPLvNext APIs? It's easy to see when |
Would it be possible to update the code sample so that it works with Test Explorer? That would certainly help me (and others) understand what's involved in making that work. |
I have questions regarding test case uniqueness: https://github.com/microsoft/vstest/blob/main/docs/RFCs/0017-Managed-TestCase-Properties.md
If I'm reading this correctly, then in the situation where I discover a single test case which will end up yielding multiple test results, then there is a conflict between the unique ID that is presented during discovery and the unique ID that would be used for reporting the How does VSTest/Test Explorer reconcile this? |
I'm going to open some new issues rather than adding more comments to this one. |
The protocol documentation is a good start, but it leaves a lot of unanswered questions about how runners are intended to actually communicate with tests. Right now that information appears to be locked up inside of
Microsoft.Testing.Extensions.VSTestBridge
(for which I've been unable to find the official source). Reverse engineering thedotnet test
interactions seems to indicate that it uses a command line switch (--internal-msbuild-node
) that's expected to let the test know that it should open a named pipe for communication. I have not yet tried to determine how Test Explorer (in VS or in VS Code) works (or doesn't yet work) here.This leaves me with two problems.
Understanding the expectations on unit test projects
I do not intend to use the VSTest bridge in xUnit.net v3, so I'm left trying to decode the interactions and support them myself. What are the command line switches that I'm expected to recognize and handle? How can I directly create and use an instance of
NamedPipeClient
? I'm currently hacking in usingTestApplication
but I'd like to understand how I can do what that does myself, as the API there isn't necessarily a good fit for me.Understanding the expectations on unit test runners
In the process of supporting meta-runners like
xunit.v3.console
, which can run multiple test assemblies, I would like to become the server side of the IPC protocol. Given that there is no abstraction equivalent toTestApplication
, how can I directly create and use an instance ofNamedPipeServer
to be the test host?The text was updated successfully, but these errors were encountered: