mmanela / chutzpah

Chutzpah is an open source JavaScript test runner which enables you to run unit tests using QUnit, Jasmine, Mocha and TypeScript.
http://mmanela.github.io/chutzpah/
Apache License 2.0
550 stars 142 forks source link

Exit code 2 when running with vstest #804

Closed timprice17 closed 3 years ago

timprice17 commented 3 years ago

vstest.console.exe 16.10 works with Chutzpah 4.2.3. But upgraded to Chutzpah 4.4.11, and it fails with exit code of 2. chutzpah.console.exe also works by itself in 4.4.11, so I'm not sure if I'm missing something in the vstest command line. (I get the same results with vstest.console.exe when running from an Azure DevOps pipeline.)

Here's the output of running vstest:

> "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.

Thank you

timprice17 commented 3 years ago

Never mind! Found the solution. I'm using Engine: Chrome, and the newer version of Chutzpah was failing to find chrome.exe. Defining the path to the exe in Chutzpah.json resolved the issue.

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