-
Notifications
You must be signed in to change notification settings - Fork 320
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
Unable to specify custom test adapter path #4241
Comments
@MarcoRossignoli, the TestAdapterLoadingStrategy can be used to facilitate this. If you set it to |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 10 days. |
Ever tried something like that?
Because I just started to create from scratch and with some trial and error, this worked. Thus, I get the message that no test is found which is correct so far. HTH. :-) |
@holbizmetrics here is a minimal implementation of a discoverer and executor, and a test framework if you need some reference. Biggest hurdle is getting the attributes right (you already got that down), and having the dll named |
@nohwnd Yes. Meanwhile even the test appears in the Test Explorer in Visual Studio and one debug commands as well as the traits are working as well. The TestAdapter I already named correctly, but that was a coincidence. What worked for me was this: [ExtensionUri(DiscovererURI)] //[ExtensionUri("executor://NextUnitTestDiscoverer")]
DefaultExecutorUri(DiscovererURI)]//[DefaultExecutorUri("executor://NextUnitTestDiscoverer")]
[FileExtension(".dll")]
[FileExtension(".exe")]
[Category("managed")]
public class NextUnitTestDiscoverer : ITestDiscoverer
{
... In the TestDiscoverer. And in the TestExecutor: /// <summary>
///
/// </summary>
[ExtensionUri(Definitions.DiscovererURI)] //[ExtensionUri("executor://NextUnitTestDiscoverer")]
public class NextUnitTestExecutor : NextUnitBaseExecutor, ITestExecutor
{
... For anyone who may still encounter the same problem... P.S.: I don't know why the formatting now looks like this considering the code. Tried to change that multiple times. |
Fixed your comment, you need to use |
Firstly, to the original poster: As far as I understand it is the normally behavior THAT *.TestAdapter.dll will be called. *.TestAdapter.dll But other hints have been added already.
|
There is a built in collection of env variables that will wait for you to attach debugger to host or runner: VSTEST_HOST_DEBUG=1 Or if you use our Playground, or build the AttachVS project that is part of our solution, and put the exe on PATH. Then it can attach automatically back to your VS. Either the one that started the execution, or one of your choosing: VSTEST_RUNNER_DEBUG_ATTACHVS=1 If you set 1 in this env variable it will take the current process and search for parent VS. If you set any other positive number, it will try to find that process ID and will try to find parent ID. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 10 days. |
Description
I am trying to create a custom test adapter which is intended to run before nunit3.testadapter. I have a requirement of executing tests with custom test adapter and for some conditions tests should run using nunit3.testadapter executor something like this.
I tried out the following solutions:
dotnet test --test-adapter-path C:\Adapters
vstest.console.exe dll_path /TestAdapterPath:"C:\Adapters"
RunConfiguration.TestAdaptersPaths
node as given below and specified this runsettings path todotnet test
but every time *.TestAdapter.dll from source dll directory is getting picked.
The custom test adapter should be picked in an ideal scenario, but this isn't working. Can someone please help me to achieve this?
Steps to reproduce
Expected behavior
Custom test adapter should be picked.
Actual behavior
*.TestAdapter.dll
at source dll directory is picked.Diagnostic logs
Environment
The text was updated successfully, but these errors were encountered: