简体   繁体   English

安装了TFS Console 2015并在我的VM上安装了VS2015和VS2013。需要在Same VM上运行测试(2013和2015)

[英]Installed TFS Console 2015 and have both VS2015 and VS2013 on my VM.Need to run Tests(2013 and 2015) on Same VM

In our project we have Unit tests specific to VS2013 and VS2015.We have a requirement of using one build definition (Virtual machine) to run both VS2013 and VS2015 Tests on different timings. 在我们的项目中,我们有针对VS2013和VS2015的单元测试。我们要求使用一个构建定义(虚拟机)在不同的时间运行VS2013和VS2015测试。

I have installed on that VM Team Foundation Server 2015 Console and created one controller and 2 agents(each for specific version of visual studio). 我已在该VM Team Foundation Server 2015控制台上安装并创建了一个控制器和2个代理(每个代理用于特定版本的visual studio)。

We are using 2013 build template. 我们正在使用2013构建模板。

I have ran successfully 2015 UTs on that Virtual Machine(VM) but when I try to run VS2013 specific UTs it is picking up 2015 vstest.exe and throwing exception. 我已经在该虚拟机(VM)上成功运行了2015年的UT,但是当我尝试运行VS2013特定的UT时,它正在挑选2015 vstest.exe并抛出异常。

Is there any way to achieve this?? 有没有办法实现这个?

I tried to include MTest Activity build template.Activity is running but it is saying no tests to execute. 我试图包含MTest Activity构建模板。活动正在运行,但它说没有要执行的测试。

I even tried to run throught batch file invoke,this way it is running but through MSTest Activity it is not running scripts.Below is snapshot of TFS log for MSTEST activity 我甚至尝试运行批处理文件调用,这样它运行但是通过MSTest Activity它没有运行脚本.Below是MSTEST活动的TFS日志的快照

在此输入图像描述

By default, TFS calls the corresponding version of VS to run tests. 默认情况下,TFS调用相应版本的VS来运行测试。 There is no way to specify the VS version for a test in XAML build with default build process template. 无法使用默认构建过程模板在XAML构建中为测试指定VS版本。 You would need to customize your build process template by adding InvokeProcess activity to invoke 2013 vstest.exe to run tests. 您需要通过添加InvokeProcess活动来自定义构建过程模板,以调用2013 vstest.exe来运行测试。

Since you are using TFS 2015, I'd like to suggest you use new build system, which is tasks based. 由于您使用的是TFS 2015,我建议您使用基于任务的新构建系统。 In new build system, you can add Visual Studio Test task to run tests. 在新的构建系统中,您可以添加Visual Studio Test任务来运行测试。 In this task, you can specify VSTest version: 在此任务中,您可以指定VSTest版本:

在此输入图像描述

Check this article for more information: https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/getting-started-with-continuous-testing 有关更多信息,请查看此文章: https//www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/getting-started-with-continuous-testing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM