首页 > 解决方案 > Chutzpah 4.4.11 在使用 vstest 运行时失败,退出代码为 2

问题描述

vstest.console.exe 16.10 适用于 Chutzpah 4.2.3。但是升级到 Chutzpah 4.4.11,退出代码为 2 失败。chutzpah.console.exe 在 4.4.11 中也可以单独工作,所以我不确定我是否在 vstest 命令行中遗漏了一些东西。(从 Azure DevOps 管道运行时,我使用 vstest.console.exe 得到相同的结果。)

有什么建议么?

> "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
 "[path-to-test-file]\index-tests.js"
 /TestAdapterPath:"C:\Users\TFSBuild\.nuget\packages\chutzpah\4.4.11\tools"
Microsoft (R) Test Execution Command Line Tool Version 16.10.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Error: Unknown error occurred when executing test file. Received exit code of 2
While Running:[path-to-test-file]\index-tests.js

No test is available in [path-to-test-file]\index-tests.js. 
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

Test Run Failed.

标签: automated-testsvstestchutzpah

解决方案


找到了解决方案。我正在使用引擎:Chrome,而较新版本的 Chutzpah 无法找到 chrome.exe。在 Chutzpah.json 中定义 exe 的路径解决了这个问题。

  "Engine": "Chrome",
  "EngineOptions": {
    "ChromeBrowserPath": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
  }

推荐阅读