我的团队正在尝试将Chutzpah集成到TFS 2012构建过程中。我们使用this blog post作为起点。
在高层次上,实际问题是构建代理上下文中的Visual Studio Test Runner根本找不到厚颜无耻的钩子。因此,虽然我们可以将**\*.js定义为测试源,但实际上在没有找到和初始化Chutzpah引导程序的情况下,测试运行器不会对这些文件执行任何操作。
在更详细的层面上,当我们检查加载构建控制器的自定义程序集的日志时,我们会得到三条相关的消息:
Summary: There were 0 failures, 2 errors and 1 warnings loading custom activities and services.
Error: Method 'ToXml' in type 'Chutzpah.VS2012.TestAdapter.ChutzpahAdapterSettings' from assembly 'Chutzpah.VS2012.TestAdapter, Version=2.2.0.171, Culture=neutral, PublicKeyToken=1ca802c37ffe1896' does not have an implementation.
Error: API restriction: The assembly '...\AppData\Local\Temp\VSTFSBuild\8c8e9402-1169-4782-99a9-ce42f83be8f0\A1288811191\Chutzpah\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
Warning: Could not load file or assembly '...\AppData\Local\Temp\VSTFSBuild\8c8e9402-1169-4782-99a9-ce42f83be8f0\A1288811191\Chutzpah\phantomjs.exe' or one of its dependencies. The module was expected to contain an assembly manifest.除了这些信息,我们或多或少被卡住了。我很乐意听到有人在独立的2012构建服务器上运行Chutzpah,这样我们就可以比较配置。
发布于 2012-11-16 01:36:37
错误: API限制:程序集'....
指示TFS正在两个不同位置查找dll。您可以更改模式,以检查和查看是否将\\test.dll设置为任何测试程序集的值,并将其更改为*test*.dll。这将防止它多次加载它。
另一个错误可能是因为测试项目没有被重新构建。尝试重新构建测试项目。
我希望这能帮到你。
发布于 2012-12-08 08:51:24
实际上Software Carpenter有一个观点,我相信可能发生的是你的普通单元测试的测试规范可能是test.dll (或类似的东西),这意味着TFS作为单元测试dll加载,然后TFS在尝试运行chutzpah测试时再次尝试加载它。
尝试禁用常规的单元测试规范,看看它是否有帮助,如果有帮助,则将您的规范更改为不包含TestPlatform.ObjectModel.dll的其他规范(*test.dll)。
来源:当我试图构建一个名称为Test的项目时,我也遇到了同样的错误。
发布于 2013-01-30 22:27:31
这一讨论也在Codeplex上进行。也许可以在那里提供一些帮助。
Javascript Unit Tests on Team Foundation Service with Chutzpah
https://stackoverflow.com/questions/13184146
复制相似问题