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

Question: xunit #3

Open
borgdylan opened this issue Sep 10, 2017 · 10 comments
Open

Question: xunit #3

borgdylan opened this issue Sep 10, 2017 · 10 comments
Assignees

Comments

@borgdylan
Copy link

Is the VS adapter for xunit supported, or is this extensions keyed in to MSTest specifically?

@borgdylan
Copy link
Author

borgdylan commented Sep 10, 2017

Also, how does the extension work? I did not see any .NET code for hosting the test adapters and got curious.

@gfrancischini
Copy link
Owner

@borgdylan, it should work with xunit has a test adapter written to work with vstest framework.

The extension works by implementing the vstest protocol. The extension open a server and trade msgs with the vstest executable.

In theory if the xunit has a testadapter.dll and you specify it right you should be able to run it. If you have a sample project I can try to setup and check if its working.

@borgdylan
Copy link
Author

I could not manage to make your sample project work on my machine. Is it compatible with Linux?

@borgdylan
Copy link
Author

Or does it require the .NET Core CLI to be present?

@borgdylan
Copy link
Author

As a side note, please do not use windows specific paths for the log file. You have hard coded a path to your user profile (with your user name and all) into the extension. On linux this makes a file in the project root with a very long path that has back-slashes in it.

@borgdylan
Copy link
Author

The log reads:

TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.804, 3161238241536, vstest.console.dll, TestPluginCache: Discovering the extensions using extension path.
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.808, 3161240271176, vstest.console.dll, AssemblyResolver: Microsoft.TestPlatform.TestHostRuntimeProvider: Resolving assembly.
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.809, 3161240643097, vstest.console.dll, AssemblyResolver: Microsoft.TestPlatform.TestHostRuntimeProvider: Resolved assembly. 
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.812, 3161243705804, vstest.console.dll, AssemblyResolver: Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger: Resolving assembly.
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.812, 3161243987260, vstest.console.dll, AssemblyResolver: Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger: Resolved assembly. 
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.813, 3161245040564, vstest.console.dll, TestPluginCache: Discovered the extensions using extension path ''.
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.813, 3161245113986, vstest.console.dll, TestPluginCache: Discoverers are ''.
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.813, 3161245154900, vstest.console.dll, TestPluginCache: Executors are ''.
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.813, 3161245194721, vstest.console.dll, TestPluginCache: Setting providers are ''.
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.813, 3161245226278, vstest.console.dll, TestPluginCache: Loggers are ''.
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.822, 3161253634668, vstest.console.dll, Trying to connect to server on port : 35531
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.822, 3161254100946, vstest.console.dll, Trying to connect to server on port : 35531
TpTrace Information: 0 : 11562, 5, 2017/09/11, 07:19:00.833, 3161264869824, vstest.console.dll, Connected to the server successfully 
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.883, 3161314843698, vstest.console.dll, DesignModeClient: Processing Message of message type: Extensions.Initialize
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.885, 3161316809782, vstest.console.dll, TestRequestManager.InitializeExtensions: Initialize extensions started.
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:00.885, 3161317000953, vstest.console.dll, TestPluginCache: Updating loadOnlyWellKnownExtensions from False to False.
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.885, 3161317067579, vstest.console.dll, TestRequestManager.InitializeExtensions: Initialize extensions completed.
TpTrace Information: 0 : 11562, 2, 2017/09/11, 07:19:00.885, 3161317202632, vstest.console.dll, DesignModeClient: Processing Message of message type: ProtocolVersion
TpTrace Error: 0 : 11562, 2, 2017/09/11, 07:19:05.266, 3165698151917, vstest.console.dll, DesignModeClient: Error processing request: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
   at System.IO.__Error.EndOfFile()
   at System.IO.BinaryReader.ReadByte()
   at System.IO.BinaryReader.Read7BitEncodedInt()
   at System.IO.BinaryReader.ReadString()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveMessage()
   at Microsoft.VisualStudio.TestPlatform.Client.DesignMode.DesignModeClient.ProcessRequests(ITestRequestManager testRequestManager)
TpTrace Verbose: 0 : 11562, 2, 2017/09/11, 07:19:05.278, 3165710381134, vstest.console.dll, Executor.Execute: Exiting with exit code of 0

@borgdylan
Copy link
Author

It cannot seem to find the xunit vstest adapter in the output folder.

@borgdylan
Copy link
Author

Looking at your code: This extension is clearly only for windows. It is using back slashes in hard coded manner while discovering test adapters. It is also assuming a case-insensitive filesystem. It looks for TestAdapter.dll as the suffix of the adapter library whereas the xunit one uses testadapter.dll as a suffix.

Please support other platforms as well. This extension is sorely needed as no one else has done an extension with a UI as nice as this.

@borgdylan
Copy link
Author

I tried to do some changes to your code, but I hit a bug in vstest itself. It is not running the testhost correctly for net46 projects.

@gfrancischini
Copy link
Owner

Ok, I will update the back slashes to a better approach. Also I will check how to make xunit projects to work.

Also thanks for the log thing, I completely forgot to make the path relative!

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