6

Closed

Test Explorer Adapter shows no js tests

description

Hi,

Have installed both the test explorer adapter as well as the context menu extension. When I right click and select Chutzpah's Run JS Tests it all works and I get status output in the Output window. However, when I do Ctrl A + R (run all tests in VS) no tests are shown in the test explorer.

Am I missing something? Do I have to do some extra configuration to tell Chutzpah where the tests are located? (They reside in the same project as the regular C#-unit tests.)

/Fredrik

file attachments

Closed Dec 23, 2013 at 6:16 PM by mmanela

comments

Infolyzer wrote Dec 17, 2013 at 1:33 PM

Another detail: when i execute "Run all tests" in VS I can see what is going on in the Output window by selecting "Build" or "Tests" from the "Show output from" dropdown. However, when I right-click and execute Chutzpah's Run JS Tests it show output under "Test".

So, in the dropdown list I have these items:
Build, Build order, Debug, JavaScript Language Service, Test and Tests.

I am running the latest version of Chutzpah with VS2013 Premium.

mmanela wrote Dec 17, 2013 at 2:58 PM

Are you using version 3.0? If so to help debug your issue I would like you to enable chutzpah tracing. If you go to Tools->Options->Chutzpah there will be a setting to enable tracing which will output a chutzpah.log file to your %temp% dir. Please do the following:
  1. Close the solution
  2. turn this setting one
  3. open your solution
  4. open the test explorer if it is not open
  5. It should be showing that it is trying to find tests
  6. Wait a couple minutes and when it stops send me the chutzpah.log file.

Infolyzer wrote Dec 18, 2013 at 7:04 AM

Yes, I am using 3.0. Tracing is on and it says that it has found one test (which is correct). But it is not showing up in the test explorer. See the log file attached.

Infolyzer wrote Dec 18, 2013 at 7:05 AM

Web Publish Package: Entering ProjectClosed
Web Publish Package: Removing a project publish data
Web Publish Package: Unadvise shell related events
Web Publish Package: Exiting ProjectClosed
devenv.exe Information: 0 : Time:09:01:20.4536573; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.4926690; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.7367422; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8327710; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8347716; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8357719; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8447746; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8467752; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8487758; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8507764; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8537773; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8547776; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8557779; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8577785; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8587788; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8597791; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8617797; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8637803; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8657809; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8667812; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8677815; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8687818; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8697821; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8717827; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8727830; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8737833; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8757839; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8777845; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8787848; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8807854; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8817857; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8837863; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8847866; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8847866; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8867872; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8877875; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8897881; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8907884; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8947896; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8967902; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8977905; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.8987908; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.9017917; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.9027920; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.9047926; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.9538073; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:09:01:20.9558079; Thread:1; Message:Chutzpah.json file not found
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 1 found (0:00:00,640192) ==========
Informational: ------ Run test started ------
Informational: ========== Run test finished: 1 run (0:00:00,630189) ==========

Infolyzer wrote Dec 18, 2013 at 7:06 AM

Here's my QUnit test:

/// <reference path="../../navet.web/scripts/app/leadviewmodel.js" />
/// <reference path="../scripts/qunit.js" />

test("First QUnit test", function() {
var x = 3;
equal(x, 5, "Should be 5");
});

mmanela wrote Dec 18, 2013 at 4:02 PM

That log is very strange. I would expect to see more.
Can you send me a zip of your solution so I can see if I repro locally

patburke234 wrote Dec 18, 2013 at 4:21 PM

I am having the exact same issue. All tests are discovered and run fine in v.2.5, but after upgrading to v.3.0 no test are discovered. Also, the following output is put into the "JavaScript Language Service" output:

11:55:58.0400: Referenced file '~/Scripts/_references.js' not found.
11:55:58.0400: Referenced file '/lib/jasmine.js' not found.
11:55:58.0400: Referenced file '../../web/scripts/lib/jquery-1.10.1.js' not found.
11:55:58.0400: Referenced file '../../web/scripts/lib/jquery.validate.js' not found.
11:55:58.0400: Referenced file '../../Web/Scripts/lib/amplify.js' not found.
....

All of my files use the ///<reference path='../../etc' /> syntax. I saw in the upgrade notes that the way references are handled has slightly changed. Could this be related? These references were found in v.2.5.

patburke234 wrote Dec 18, 2013 at 4:35 PM

FWIW, here is the Chutzpah.log file after adding the Tracing = true:

Web Publish Package: Entering ProjectClosed
Web Publish Package: Removing a project publish data
Web Publish Package: Unadvise shell related events
Web Publish Package: Exiting ProjectClosed
Web Publish Package: Entering GetPublishableProjectCfg
Web Publish Package: Creating a new project publish data
Web Publish Package: Advise shell related events
Web Publish Package: Exiting GetPublishableProjectCfg
Web Publish Package: Entering ProjectOpened
Web Publish Package: Exiting ProjectOpened
Informational: ------ Load Playlist started ------
Informational: ========== Load Playlist finished (0:00:00.0100006) ==========
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 133 found (0:00:01.4460827) ==========

mmanela wrote Dec 18, 2013 at 5:55 PM

Hmm that is strange. Can you both do two more things for me
  1. Give me zips of your projects so I can test. I haven't hit these issues in my testing so it could be something wierd but I want to rule out anything in the project.
  2. Run VS with the /Log argument and repro the issue thensend me that activity log (http://msdn.microsoft.com/en-us/library/ms241272.aspx)

mmanela wrote Dec 18, 2013 at 5:57 PM

Also, @patburke234 w, is that the log after running the repro again by closing then opening the solution? I expect to see more in it

patburke234 wrote Dec 18, 2013 at 7:58 PM

Yes, that is the full log. When testing a simple sample application, Chutzpah works correctly. This makes me think it has to do with the solution layout, but this doesn't explain why half of the developers on my team with the exact same version of VS and Chutzpah, working off of the same solution from Source Control, is getting all of the tests discovered and run while the other half are getting issues like I am.

I am thoroughly confused by this. By that logic, it cannot be the solution and has to be something that the plugin in reacting to on our local machines.

In the successful cases, the log is littered with Phantom.js messages. In the invalid cases, it seems that Phantom is never even initiated.

patburke234 wrote Dec 18, 2013 at 8:01 PM

I just verified that everything works perfectly with VS 2012 (Update 4) on the same solutions across all developers machines, but fails to discover for half of us in VS 2013.

jimsleon wrote Dec 19, 2013 at 2:08 AM

Here is the content of Chutzpah.log. I also attached a very simple solution.

devenv.exe Information: 0 : Time:11:01:04.8435240; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:04.9095306; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.0105407; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.0865483; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.1405537; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.1545551; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.1625559; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.1745571; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.1855582; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.1995596; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.2935690; Thread:1; Message:Chutzpah.json file not found
devenv.exe Information: 0 : Time:11:01:05.3845781; Thread:1; Message:Chutzpah.json file not found
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 0 found (0:00:05.2125212) ==========
Entering constructor for: Microsoft.Cct.CctSharedPackage
Entering Initialize() of: Microsoft.Cct.CctSharedPackage

koistya wrote Dec 19, 2013 at 5:45 AM

Here is the output from my %temp%\chutzpah.log file when I open and build the following project in Visual Studio 2013 with Chutzpah 3.0:

AngularJS SPA Template for Visual Studio
devenv.exe Information: 0 : Time:10:41:32.3183310; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts
devenv.exe Information: 0 : Time:10:41:32.4093609; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts\typings\angularjs
devenv.exe Information: 0 : Time:10:41:32.4123606; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts\typings\jasmine
devenv.exe Information: 0 : Time:10:41:32.4123606; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts\typings\jquery
devenv.exe Information: 0 : Time:10:41:32.4133605; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts\typings\signalr
devenv.exe Information: 0 : Time:10:41:32.4143525; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts\vendor
devenv.exe Information: 0 : Time:10:41:32.4343363; Thread:1; Message:Chutzpah.json file found at c:\projects\angularjs spa template\src\web\scripts\chutzpah.json given directoy c:\projects\angularjs spa template\src\web\scripts\vendor\i18n
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 0 found (0:00:09,3969574) ==========
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 0 found (0:00:00,1440309) ==========
Entering constructor for: Microsoft.Cct.CctSharedPackage
Entering Initialize() of: Microsoft.Cct.CctSharedPackage
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 0 found (0:00:00,1119959) ==========
Informational: ------ Discover test started ------
Informational: ========== Discover test finished: 0 found (0:00:00,1050035) ==========

mmanela wrote Dec 19, 2013 at 6:58 PM

I have a repro and I am investigating further. Until I figure it out you can downgrade to the old version: https://skydrive.live.com/?mkt=en-US#cid=D08E5C6BF97C4C7B&id=D08E5C6BF97C4C7B%2117982

mmanela wrote Dec 22, 2013 at 10:56 PM

I found a fix and released it in version 3.0.1. Please upgrade and let me know if it resolves your issues.

jimsleon wrote Dec 23, 2013 at 4:35 AM

It works for me.

Infolyzer wrote Jan 7 at 7:54 AM

Works for me as well. Good work!

midix wrote May 10 at 6:46 AM

Today I noticed the same issue. I pulled my hair out to find why tests are visible in Test Explorer in one Visual Studio solution and not visible in another one. Then I took the broken solution and stripped away everything to leave the bare minimum which doesn't work. And I found out something surprising.

if you have your tests in some solution folder as I do - I have my test projects in solution Tests folder - and if you happen to name your test project with .JS or .Js at the end - I did something like MyCompany.MyTests.Js - then suddenly Visual Studio does not see not only the tests in the MyCompany.MyTests.Js project, but also all the other Chutzpah tests in other projects.

To fix the issue, I have too workarounds:
drag MyCompany.MyTests.Js project out of the Tests folder in your solution
rename it to not contain the .Js at the end.
You don't even have to reload solution - just do one of the two workarounds above, Click "Run All" in your Test Explorer, and suddenly all your Chutzpah tests will appear in the Test Explorer.

I don't know if it's Chutzpah fault or not but the lesson to learn is: don't name your projects with names which seem like file extensions when you put them in a separate solution folder.

Attached a broken VS 2013 solution if somebody wants to play with it.

By the way, the message "The directory name is invalid." sometimes is also caused by missing .suo file for solution. I usually do not store them in Source Control, thus some users see this message when opening a solution for the first time. And also the same message is visible in Visual Studio Tests Output when trying to run tests for the broken solution.

koshelew wrote May 20 at 9:06 PM

Got same issue today - VS 2013 Ultimate Update 2 RC
Both Chutzpah extensions 3.2.2

The log files seems to show the right files:

devenv.exe Information: 0 : Time:23:54:41.0315439; Thread:1; Message:Adding watch on c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit\chutzpah.json
devenv.exe Information: 0 : Time:23:54:41.0315439; Thread:1; Message:Adding watch on c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit\validatorsprovider.js
devenv.exe Information: 0 : Time:23:54:41.0325440; Thread:1; Message:Determining if 'c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit\validatorsprovider.js' might be a test file
devenv.exe Information: 0 : Time:23:54:41.0325440; Thread:1; Message:Chutzpah.json file found at c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit\chutzpah.json given starting directoy c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit
devenv.exe Information: 0 : Time:23:54:41.0335440; Thread:1; Message:Assuming 'c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit\validatorsprovider.js' is a test file
devenv.exe Information: 0 : Time:23:54:41.0335440; Thread:1; Message:Added test container for 'c:\users\trenzalore\source\repos\ngdynamicvalidator\ngdynamicvalidator\unit\validatorsprovider.js'

I can run them, but test explorer stays blank.

mmanela wrote May 20 at 9:26 PM

@koshelew, Can you file a new issue with a repro?