This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245463 - Run tests I
Summary: Run tests I
Status: RESOLVED FIXED
Alias: None
Product: qa
Classification: Unclassified
Component: Synergy (show other bugs)
Version: 8.0.1
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Vladimir Riha
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-08 08:21 UTC by John Jullion-ceccarelli
Modified: 2014-07-08 09:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Jullion-ceccarelli 2014-07-08 08:21:37 UTC
I only have the Chrome plugin installed, Testing sample_karma plugin opens Chrome and gives following output in Output tab but never displays Test Results window.

"/bin/bash" "-lc" "\"/usr/local/bin/karma\" \"start\" \"/Users/jjullion/NetBeansProjects/sample_karma/config/karma.conf.js\" \"--port\" \"9877\""
WARN [plugin]: Cannot find plugin "karma-junit-reporter".
  Did you forget to install it ?
  npm install karma-junit-reporter --save-dev
WARN [plugin]: Cannot find plugin "karma-phantomjs-launcher".
  Did you forget to install it ?
  npm install karma-phantomjs-launcher --save-dev
WARN [plugin]: Cannot find plugin "karma-firefox-launcher".
  Did you forget to install it ?
  npm install karma-firefox-launcher --save-dev
WARN [karma]: Port 9877 in use
INFO [karma]: Karma v0.12.16 server started at http://localhost:9878/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 35.0.1916 (Mac OS X 10.9.3)]: Connected on socket T3DxXYbpn5Rlm-VhDjm1 with id 69728885
Comment 1 Tomas Mysik 2014-07-08 08:25:53 UTC
(In reply to John Jullion-ceccarelli from comment #0)
> Testing sample_karma plugin

Where can I find it so I can test it?

> INFO [Chrome 35.0.1916 (Mac OS X 10.9.3)]: Connected on socket
> T3DxXYbpn5Rlm-VhDjm1 with id 69728885

Apparently no tests were run so no results. I need to reproduce the issue on my PC to investigate it more.

Thanks.
Comment 2 Vladimir Riha 2014-07-08 08:37:15 UTC
I think this is mistake in the test specification, karma used to be installed globally together with its plugin launchers:

npm install -g karma
npm install -g karma-[BROWSER]-launcher

John, did you install them? 

I'll will update the steps, Karma is now preferred to be installed locally and the plugins should be as well. I'll update the specification/sample project so it will use the new "npm install" feature in NetBeans and install all these dependencies for you (I'm sorry I didn't put them properly to package.json). 


Tomas, the project could be downloaded from 
http://services.netbeans.org/synergy/server/api/attachment.php?id=201
Comment 3 John Jullion-ceccarelli 2014-07-08 08:44:47 UTC
Yup Karma and the Chrome plugin are installed correctly and testing works on other projects. Just the sample-karma project it doesn't work on.
Comment 4 John Jullion-ceccarelli 2014-07-08 08:45:57 UTC
I also did npm install on the project so all of the karma modules are installed locally as well. Is this a problem that I have karma installed both globally and locally?
Comment 5 Vladimir Riha 2014-07-08 08:56:30 UTC
Local and global should be an issue (I used to have as well until now - you can go to project properties->JavaScript testing->Karma to find which karma is used). Please try to stop karma if it is running, replace content of package.json with

{
  "name": "sample_karma",
  "devDependencies": {
    "karma": "~0.10",
    "karma-chrome-launcher": "^0.1.4",
    "karma-firefox-launcher": "^0.1.3",
    "karma-ie-launcher": "^0.1.5",
    "karma-jasmine": "~0.1",
    "karma-junit-reporter": "~0.1",
    "karma-ng-scenario": "~0.1",
    "karma-opera-launcher": "^0.1.0",
    "karma-phantomjs-launcher": "^0.1.4",
    "karma-safari-launcher": "^0.1.1",
    "phantomjs": "~1.9"
  }
}

and again invoke the npm install. It should work then.


Karma is complaining about missing karma-firefox-launcher etc., which are used in karma.conf.js (in Configuration files). Other projects likely don't use these plugins so karma does not need them. I think that chrome launcher is installed together with karma by default but firefox, ie, etc. must be installed separately.

I'm updating the sample_karma and will upload it to the specification once I verify it works (but I think the only change will be the package.json).
Comment 6 John Jullion-ceccarelli 2014-07-08 09:13:32 UTC
In Project Properties I was still using global Karma, switched it to local, replaced package.json contents and reran npm install. Still no tests being run. Output:

"/bin/bash" "-lc" "\"/Users/jjullion/NetBeansProjects/sample_karma/node_modules/karma/bin/karma\" \"start\" \"/Users/jjullion/NetBeansProjects/sample_karma/config/karma.conf.js\" \"--port\" \"9877\""
WARN [karma]: Port 9877 in use
INFO [karma]: Karma v0.10.10 server started at http://localhost:9878/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 35.0.1916 (Mac OS X 10.9.3)]: Connected on socket yOL00uzF7KYzxkhNPaIl
Comment 7 Vladimir Riha 2014-07-08 09:19:41 UTC
Have you also right clicked on project and selected "Test" action? If you start Karma by clicking on Karma node in Projects window, it only starts Karma server. In order to run tests, you need to right click on the project and select "Test" (clicking on Test also starts Karma server if needed so you don't have to invoke Karma->Start manually, only Test on the project)
Comment 8 John Jullion-ceccarelli 2014-07-08 09:33:51 UTC
Weird. Restarted NB and it worked. 99% sure I was using Test action.
Comment 9 Vladimir Riha 2014-07-08 09:50:37 UTC
I cannot reproduce it, so it is hard to tell. Please reload the specification page, I've made some changes and uploaded a fixed version of the sample project. It should work now. Thank you for catching that.