vendredi 22 janvier 2016

Chutzpah on Visual Studio Team Services scripted build

I am trying to get Chutzpah to work in Microsoft's Visual Studio Team Services scripted build environment. For those of you unfamiliar with it it is a hosted build server so there is no opportunity to install anything on this server as it is not ours. We have JavaScript test files that use Jasmine as the test framework and we can run the tests from Visual Studio 2015 using Chutzpah in the test explorer and also from the short cuts. Our unit test project also has the latest Chutzpah NuGet package installed.

After reading the logs from the build server I saw the following:

  1. The javascript unit test files are found as it lists them all in the command line to execute.
  2. The tool used to execute the unit tests is vstest.console.exe

My next step in troubleshooting is to see if I can get vstest.console.exe to execute the javascript test files on my local PC. If I can figure that out then I can probably get it to work on the scripted build server as well. I have tried the following.

  • Command: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
  • Javascript file to test: D:\TfsOnline\MyBranch\MyUnitTestProject\Spec\ngControllerTests.js its a test for some AngularJS controller
  • logger - trx
  • TestAdapterPath - D:\TfsOnline\MyBranch\packages
  • Settings - D:\TfsOnline\MyBranch\TestSuite.runsettings I could not figure out if I can or should specify a specific test adapter here

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "D:\TfsOnline\MyBranch\MyUnitTestProject\Spec\ngControllerTests.js" /logger:trx /TestAdapterPath:"D:\TfsOnline\MyBranch\packages" /Settings:""D:\TfsOnline\MyBranch\TestSuite.runsettings"

Microsoft (R) Test Execution Command Line Tool Version 14.0.24720.0
Copyright (c) Microsoft Corporation.  All rights reserved.
Starting test execution, please wait...
Warning: No test is available in the provided sources. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

So it seems like the Chutzpah test adapter is not found. I then tried this command to see if the adapter could be found:

> "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" /TestAdapterPath:"D:\TfsOnline\MyBranch\packages" /ListExecutors

Microsoft (R) Test Execution Command Line Tool Version 14.0.24720.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Warning: The Test Executor Add-Ins installed through a VSIX installation are ignored. Use the /UseVsixExtensions parameter to include them, if your installation supports vsix extensions. Example: vstest.console.exe /ListExecutors /UseVsixExtensions:true

The following Test Execution Add-Ins are available:
Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter.GenericTestExecutor
                Uri: executor://GenericTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Extensions.MSAppContainerAdapter.MSAppContainerTestExecutor
                Uri: executor://MSAppContainerTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter.OrderedTestExecutor
                Uri: executor://OrderedTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Extensions.VSTestIntegration.MSTestExecutor
                Uri: executor://MSTestAdapter/v1
Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension.TestExecutor
                Uri: executor://CppUnitTestExecutor/v1
Chutzpah.VS2012.TestAdapter.ChutzpahTestExecutor
                Uri: executor://chutzpah-js

The adapter I want is listed, Chutzpah.VS2012.TestAdapter.ChutzpahTestExecutor.

Where should I be looking next?

  1. Settings - D:\TfsOnline\MyBranch\TestSuite.runsettings - Is there something that is missing here that is specific to Chutzpah? Currently I am using the default settings similar to those found here.
  2. Chutzpah settings - chutzpah.json - Is there something else I should be including in this file? Again, Chutzpah works in Visual Studio Test Explorer but maybe there is something specific I need to include.
  3. Some other switch in the command vstest.console.exe? I did not see anything else where I can force an adapter to be used in the /? switch that lists the help.

Any direction or help would be greatly appreciated! If I am missing something like content of a settings file that would help me figure out what I am missing let me know and I will add the content to the question.

Thank you in advance! -Igor

Aucun commentaire:

Enregistrer un commentaire