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 247302 - Karma.cmd isn't found using Search button when it's located in the PATH directory
Summary: Karma.cmd isn't found using Search button when it's located in the PATH direc...
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Testing (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-19 11:39 UTC by Martin Janicek
Modified: 2014-09-29 13:25 UTC (History)
1 user (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 Martin Janicek 2014-09-19 11:39:01 UTC
I have Karma installed globall (location for global npm modules seems to be C:\Users\Anyone\AppData\Roaming\npm\). When I tried using Search button in HTML project properties, it doesn't found my karma.cmd file and I had to input it manually.

This is a little bit confusing because NPM shows you, you have correctly installed karma, NetBeans points you automatically to default karma file located locally in /node_modules/karma/bin/karma, but nothing works.

Might have sense to show user an error when he's running Windows but has configured different karma file than karma.cmd
Comment 1 Martin Janicek 2014-09-19 11:41:19 UTC
To clarify it a little bit more, I think two improvements would be cool:

1/ Improving Search button to check global directory as well
2/ Shows an error when Windows user has configured anything else than  'karma.cmd' file
Comment 2 Tomas Mysik 2014-09-19 13:04:44 UTC
(In reply to Martin Janicek from comment #1)
> 1/ Improving Search button to check global directory as well

What is "global directory"? NetBeans searches karma locally and then on the PATH (on all platforms); if nothing is found for you, it seems that you do neither have karma installed in your project nor cannot run karma directly on the command line - can you please verify it?

> 2/ Shows an error when Windows user has configured anything else than 
> 'karma.cmd' file

Well, this is problematic; NetBeans should prefer karma.cmd if one clicks the Search button - please, report an issue if it is not true. We do not want to push users to select karma.cmd because they can have their own scripts named how they like; in such case, it would be bad to show an error...

The typical use case for running Karma should be - install Karma locally (IMHO Karma itself prefers this for some time now), NetBeans will find it, select a Karma config file and test your project - if anything does not work as described, please, let me know.

Not sure what to do with this issue since I don't see anything that could be fixed here, sorry...
Comment 3 Martin Janicek 2014-09-19 13:16:44 UTC
(In reply to Tomas Mysik from comment #2)
> What is "global directory"? NetBeans searches karma locally and then on the
> PATH (on all platforms); if nothing is found for you, it seems that you do
> neither have karma installed in your project nor cannot run karma directly
> on the command line - can you please verify it?

Ok, sorry didn't understand the principle of the way how NPM works. Just checked it and the karma.cmd is under the directory from PATH. I'm able to run 'karma --version' on the command line.

Although NetBeans ignores this and prefers the one from project/node_modules/karma/bin
Comment 4 Tomas Mysik 2014-09-23 09:30:56 UTC
On Windows, we will search only karma.cmd file. Also we will add a note about karma-cli package.
Comment 5 Tomas Mysik 2014-09-23 11:16:20 UTC
Should be fixed now, please verify. Thanks.

http://hg.netbeans.org/web-main/rev/c879377f2e09
Comment 6 Quality Engineering 2014-09-24 12:51:05 UTC
Integrated into 'main-silver', will be available in build *201409241121* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c879377f2e09
User: Tomas Mysik <tmysik@netbeans.org>
Log: #247302 - Karma.cmd isn't found using Search button when it's located in the PATH directory
Comment 7 Vladimir Riha 2014-09-29 13:25:10 UTC
I tried it on Windows and karma.cmd is being found (local is preferred over global), the same with "karma" on Linux. If karma binary is not found, warning with karma-cli is displayed. Verified


Product Version: NetBeans IDE Dev (Build 201409290001)
Java: 1.7.0_67; Java HotSpot(TM) Client VM 24.65-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_67-b01
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)