【发布时间】:2019-10-27 12:39:00
【问题描述】:
我需要通过构建运行位于特定文件夹中的 webtests。目前测试是从 Visual Studio 2015 运行的。 知道执行/使用下面的 powershell 脚本作为任务。但不知道如何实现它。这个powershell脚本足够了吗?
param
(
$tool = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe",
$path ,
$include = "*.webtest"
)
$web_tests = get-ChildItem -Path $paths -Recurse -Include $include
foreach ($item in $web_tests) {
$args += "/TestContainer:$item"
}
在此,如何传入 $path 值?我是否需要提供包含所有这 5 个 webtests 的目录的路径? 我是否需要一个 testsettings 文件来执行此执行。
如果我需要测试设置文件,是否需要将所有 webtests 文件复制到输出目录?
我使用这个 powershell 得到的只是以下消息
No test runs are available for this build. Enable automated tests in
your build definition by adding a task that runs tests for your test
framework of choice, such as the Visual Studio Test task. If you choose
to run tests using a custom task or runner, you can publish results
using the Publish Test Results task
任何人都可以像我在这里缺少的那样帮助我吗?感谢您的时间和帮助。
【问题讨论】:
-
只是检查提供的信息是否有用。如果您需要进一步的帮助,请告诉我们。
标签: azure powershell tfs build azure-devops