简体   繁体   English

Powershell如何影响TFS2015中的测试执行

[英]How Powershell affect test execution in TFS2015

I have ancestral project and my Nightly build fails. 我有祖传项目,我的夜间构建失败。 I can`t find out how to fix it. 我无法找到解决方法。 Problem is about test cases sequence dependent execution . 问题是关于测试用例序列依赖执行

Environment : 环境

There is used TFS2015 build definitions. 使用了TFS2015构建定义。 Basically, I have a definition with a Visual Studio Build task and then a Visual Studio Test task. 基本上,我有一个Visual Studio Build任务的定义,然后是Visual Studio Test任务。 Visual Studio Test task is also overwritten with Powershell file and I see that in TFS Nightly build process my predefined VS Ordered Test statements is ignored. Visual Studio Test任务也被Powershell文件覆盖,我发现在TFS每晚构建过程中,我的预定义VS Ordered Test语句被忽略。

Important 重要

Test cases are sequence dependent (as I said, this project is ancestral). 测试用例依赖于序列(正如我所说,这个项目是祖先的)。

Problem 问题

Interesting is that build log files always shows test execution in sequence what I define in VS Ordered Test , but at TFS2015 Detailed report Test results sequence always is different. 有趣的是,构建日志文件总是按顺序显示我在VS Ordered Test定义的测试执行,但是在TFS2015详细报告测试结果序列总是不同的。 So I can`t find out what affects test case execution procedures in TFS. 因此,我无法找出影响TFS中测试用例执行过程的因素。 Also I am not sure how tests are executed - parallel or sequentially (As I see, both TFS and PowerShell has no indications to run test cases in Parallel). 此外,我不确定如何执行测试 - 并行或顺序(我看到,TFS和PowerShell都没有指示并行运行测试用例)。

I have 2 questions : 我有两个问题

  1. Powershell brake down all in VS defined conditions? Powershell在VS定义的条件下制动全部?
  2. Which is the best way to define test execution order, so that it takes into account? 哪个是定义测试执行顺序的最佳方式,以便考虑到它?

Actually, those Test method run in the order that you defined in Ordered Test file during TFS build process. 实际上,那些Test方法按照您在TFS构建过程中在Ordered Test文件中定义的顺序运行。 The build log already shows the correct sequence. 构建日志已显示正确的序列。

Just like you mentioned above, in the test result page, the order is the same as what you defined in the Ordered Test , but you can see that in front of each test method, it has an order number. 就像你上面提到的那样,在测试结果页面中,顺序与你在Ordered Test定义的顺序相同,但你可以看到在每个测试方法的前面,它有一个订单号。 You could download the test result file to check again and you will find those test methods are run in the correct order. 您可以下载测试结果文件以再次检查,您会发现这些测试方法以正确的顺序运行。

In the higher version, like TFS 2017, you could click the Column title 'Test' to make it sort by order( 在较高版本中,如TFS 2017,您可以单击列标题“测试”以使其按顺序排序( 在此输入图像描述 ). )。

You could also add a Date started column to know which test method run the first. 您还可以添加Date started列以了解哪个测试方法运行第一个。

在此输入图像描述

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

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