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 245834 - Cannot debug JSTestDriver tests outside of project root
Summary: Cannot debug JSTestDriver tests outside of project root
Status: REOPENED
Alias: None
Product: javascript
Classification: Unclassified
Component: Testing (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-21 07:54 UTC by Vladimir Riha
Modified: 2014-10-06 13:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (58.68 KB, text/plain)
2014-07-21 07:54 UTC, Vladimir Riha
Details
sample project (4.80 MB, application/zip)
2014-07-21 07:57 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2014-07-21 07:54:13 UTC
Created attachment 148166 [details]
IDE log

Please check the attached project, it uses JSTestDriver with tests outside of project directory. The attached archive contains 2 folders:
 - sampleapp-master => project folder
 - eco2/tests => unit test folder (set unit test folder to the child "tests" folder : ../eco2/tests )


If you right click on the project and select Test and select Chrome with NB integration as target browser, tests are executed and debugger stops at _source_ breakpoints (e.g. calc.js:12), but not in tests breakpoints (e.g. jasmine.js:12).



Product Version: NetBeans IDE Dev (Build 201407210001)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2014-07-21 07:57:01 UTC
Created attachment 148167 [details]
sample project
Comment 2 Tomas Mysik 2014-07-21 10:42:44 UTC
Should be fixed now. Please verify both cases and on all platforms (there could be a problem on Windows), thanks.

http://hg.netbeans.org/web-main/rev/38ad651900ac
Comment 3 Vladimir Riha 2014-07-21 15:12:07 UTC
Thank you, I quickly tried it on Windows and it seems like JSTestDriver does not handle relative paths very well on Windows.

It embeds scripts with following URL

<script src="/test/C:/Users/vlriha/Downloads/jstdriver_sample/eco2/tests/lib/angular/angular-resource.js" type="text/javascript"></script>
<script src="/test/web/js/custom.js" type="text/javascript"></script>

And although the script is loaded in CDT if I click on the URL, JSTestDriver output is full of TypeErrors:

   TypeError: Cannot read property 'toBe' of undefined 

It looks like it cannot read files from relative URLs outside of the "current" folder. Thanks to this all tests are marked as failed... I'll give it another shot tomorrow.
Comment 4 Quality Engineering 2014-07-22 02:32:28 UTC
Integrated into 'main-silver', will be available in build *201407220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/38ad651900ac
User: Tomas Mysik <tmysik@netbeans.org>
Log: #245834 - Cannot debug JSTestDriver tests outside of project root
Comment 5 Tomas Mysik 2014-07-22 05:25:10 UTC
(In reply to Vladimir Riha from comment #3)
> <script
> src="/test/C:/Users/vlriha/Downloads/jstdriver_sample/eco2/tests/lib/angular/
> angular-resource.js" type="text/javascript"></script>

This is at least consistent with the *nix URLs (the URL is then something like "/test//tmp/mytests/test.js" - please note the double slash).

Thanks.
Comment 6 Vladimir Riha 2014-07-24 08:55:28 UTC
I'm sorry, line breakpoints in tests are still being ignored, only sources works.


Product Version: NetBeans IDE Dev (Build 201407240001)
Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)