通过安装的NuGet自定义测试适配器未发现测试 [英] Custom test adapter installed via NuGet isn't discovering tests

查看:2339
本文介绍了通过安装的NuGet自定义测试适配器未发现测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过的NuGet安装自定义测试适配器,但似乎VS是不承认它。我已经通过在Microsoft.VisualStudio.TestWindow.VsAdapters.UnitTestExtensionDiscoverer代码看,所以我已经意识到该dll有* .TestAdapter.dll结束。使用该名称使得我,当我指定/ TestAdapterPath vstest.console的工作,所以我不知道为什么VS2013的测试窗口不显示我的测试。

I'm trying to install a custom test adapter via NuGet, but it seems like VS isn't recognizing it. I've looked through the code in Microsoft.VisualStudio.TestWindow.VsAdapters.UnitTestExtensionDiscoverer, so I've realized the dll has to end with *.TestAdapter.dll. Using that name makes vstest.console work for me when I specify /TestAdapterPath, so I'm not sure why the VS2013 test window isn't showing my tests.

当由相关文件复制到C安装适配器不工作:\Program文件(x86)\Microsoft的Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

The adapter does work when installed by copying the relevant files to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions.

是否还有其他路径或文件名约定我需要遵循VS2013载入我的测试适配器?没有任何记录或错误消息我真的不知道如何收集更多的信息调试此。

Are there any other path or filename conventions I need to follow for VS2013 to load my test adapter? Without any logging or error messages I'm really not sure how to gather more information to debug this.

推荐答案

这个问题似乎一直说我是想通过在包目录覆盖我的dll调试。这不起作用,因为VS拷贝你的包目录是这样的:

The issue seems to have been that I was trying to debug by overwriting my dlls in the packages directory. This doesn't work because VS copies your package directory to something like:

%TEMP%\VisualStudioTestExplorerExtensions\My.TestAdapter.1.0.0.23

%TEMP%\VisualStudioTestExplorerExtensions\My.TestAdapter.1.0.0.23

本质的键是版本号将其高速缓存。如果将文件复制到项目目录包VS不会复制它,因为该文件夹数量没有变化。因此,更新您的扩展,你必须保持发布的NuGet包。

essentially caching it with the key being the version number. If you copy the file into the project packages directory VS won't copy it because the folder number didn't change. So, to update your extension you have to keep publishing NuGet packages.

至少这是我如何理解它。

At least that's how I understand it.

编辑:我也注意到,当你通过的NuGet升级测试适配器,它不会启动,直到您重新启动VS,或杀死vstest使用新版本*

I've also noticed that when you upgrade your test adapter through NuGet, it won't start using the new version until you restart VS, or kill vstest.*

这篇关于通过安装的NuGet自定义测试适配器未发现测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆