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.
Detailed information can be found in issue #180254, comment #30 and comment #31.
BTW you have provided incomplete NB sample project (reference to /var/www), I had to fix the test directory and require_once() in the test file. Then, code coverage works fine for me. What comes to my mind: - have you enabled the code coverage? Right click the project and choose Code Coverage > Collect and Disply Code Coverage - reopen this issue and attach the generated code coverage [1] [1] start NetBeans with "-J-Dnb.php.phpunit.keeplogs=true" and find the generated <tmp-dir>/nb-phpunit-coverage.xml. Product Version: NetBeans IDE Dev (Build 20110901-32c9999f02d6) Java: 1.6.0_24; Java HotSpot(TM) 64-Bit Server VM 19.1-b02 System: Linux version 2.6.38-11-generic running on amd64; UTF-8; cs_CZ (nb)
Created attachment 110599 [details] Coverage file generated by netbeans and not working
Created attachment 110600 [details] PHPUnitLog file generated by netbeans and not working
I reopened this bug because I have the same problem. Product Version: NetBeans IDE 7.0.1 (Build 201107282000) Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02 System: Linux version 3.0.4-desktop-nrj.69mib running on amd64; UTF-8; en_US (nb) Userdir: /home/csaba/.netbeans/7.0 phpUnit 3.5.15, SO is Linux Mandriva 2011 Attached the files requested.
To patkoscsaba@netbeans.org: Thanks for the attached files, I will have a look at them. BTW would it be possible to have a (sample) project where the code coverage does not work? It would help us a lot. Thanks.
I can do a sample project, too, if necessary. But does it have any relevance if on my machine with all and any php project the problem is the same? Anyway, I will upload a test project this evening (at about 6PM GMT)
Created attachment 110674 [details] Project which does not show any coverage data Here is a simple project. One class with one method and one test for it. The test obviously passes. In output I can see that coverage data was generated. However in NetBeans the coverage bar shows 0.00% in red
I can't reproduce your issue, attaching the PhpUnit and code coverage XML log so we can compare them. Please, do the same, I will compare those files and try to find the problem. Thanks.
Created attachment 110695 [details] PhpUnit XML log
Created attachment 110696 [details] Code coverage XML log
Please, attach your files and reopen this issue. Thanks.
Created attachment 110721 [details] Example project's coverage file
Created attachment 110722 [details] Example project's phpunit log
Attached files you requested
I compared the files and I can see no differences (except some timestamps and file paths). I am thinking, without knowing the inner working of NetBeans, is it possible that some PlugIn prevents code-coverage from working correctly? If this still can't help you figure out what's wrong I will also try a nightly build to see if it is also happening with it.
(In reply to comment #15) > I compared the files and I can see no differences (except some timestamps and > file paths). Confirmed. > I am thinking, without knowing the inner working of NetBeans, is it possible > that some PlugIn prevents code-coverage from working correctly? I don't think so but I'm not 100 % sure. > If this still can't help you figure out what's wrong I will also try a nightly > build to see if it is also happening with it. Yes, please do so. Also, you can try a clean userdir [1]. You can also try a different project. Also, please verify that your IDE log [2] does not contain any relevant exception. Thanks for your cooperation, closing as WORKSFORME for now, feel free to reopen if you have something new. [1] http://wiki.netbeans.org/FaqAlternateUserdir [2] View > IDE Log
I will do some more testing this evening. About trying a different project, this problem is present for all my projects. Both old projects and projects I create.
Hmm ... It is finally working after I started NetBeans with a clean profile (by removing ~/.netbeans) Now, I will try to export my settings from the old profile and import them to a new one. If I can figure out what it causing the problem I will make another comment here. Thanks for the assistance.
(In reply to comment #18) > It is finally working Great to hear! > after I started NetBeans with a clean profile (by > removing ~/.netbeans) Sorry. > Now, I will try to export my settings from the old > profile and import them to a new one. This should work. > If I can figure out what it causing the problem I will make another comment > here. That would be great. > Thanks for the assistance. Thank you for your cooperation.
Some updates: 1. Exporting "All" from the old profile and importing "All" into a new profile makes the problem to appear again. So, the problem is somewhere in there. 2. I, however, managed to import only the most necessary things for me, and it is working. What can be imported: keyboard shortcuts, files, start page, code templates, formatting and probably the rest from the Editor category. However I had to readd / reopen my projects.
(In reply to comment #20) > Some updates: > 1. Exporting "All" from the old profile and importing "All" into a new profile > makes the problem to appear again. So, the problem is somewhere in there. Would you be able to attach (or email me directly) the file which causes this bug? That would be perfect since I could investigate it and possibly fix the bug. Thanks.
I will attach here my exported configuration .zip file, but I can not pinpoint the problem more exactly than I explained in my previous comment. You will have the file at about 8PM GMT.
Better send the ZIP file directly to my mail since it could contain some private data (passwords etc.). Please double check it before sending, if possible. Thanks.
Perhaps this additional info will help: Beside not getting CodeCoverage info running I also cannot get the debugger running for UnitTests (but debugging works for the project itself without any problems). When installing Netbeans 7.1 I've imported the setting from my last installation, which was NB 6.9.1. Thanx for your support Horst
Some additional information about this bug. I have made some tests with the same combination of source and test files (create new project, setup test folder, put source and test files inside). If I create project on disk C: (my system disk), code coverage works. If I create project on disk D:, code coverage doesn't work. Product Version: NetBeans IDE 7.1 (Build 201112071828) Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10 System: Windows 7 version 6.1 running on x86; Cp1251; en_US (nb) User directory: C:\Users\V\.netbeans\7.1 Cache directory: C:\Users\V\.netbeans\7.1\var\cache
Sorry, haven't noticed that its Linux bug. Hope my comment will help to fix it on both Windows and Linux
Same for me - also did not see, that this is a Linix issue. I'm sorry for this. Nevertheless - to do not confuse you in finding the bug some news from my side. PhpUnit is now working ----------------------- I am using WampServer 2.2. Debugging a project in the browser uses the php.ini file inside the Apache directory. But debugging a PhpUnit project uses the php.ini file in the PHP directory. The settings for XDebug were not correct in this file. Sorry for mixing things up! Code coverage still does not work --------------------------------- Perhaps this info will help: my project files are on a different drive than the Netbeans files (I mention this since Slevin found out that this might be a reason for code coverage not working). Code coverage does work before I've updated my WampServer and Netbeans - even if the project files had been in a different directory.
(In reply to comment #27) > PhpUnit is now working Great to hear. > Code coverage does work before I've updated my WampServer and Netbeans - even > if the project files had been in a different directory. Unlikely to have something with NetBeans if it is used to work; there was no change in this area in NB for a long time. AFAIK PHPUnit uses XDebug for code coverage. Anyway, once there is a fixing phase, I will ty to evaluate this issue and fix it, if possible. Thanks.
Hi, Tomas Could you, please, say when estimated fixing phase come?
(In reply to comment #29) > Could you, please, say when estimated fixing phase come? http://wiki.netbeans.org/NetBeans_72
Apparently reproducible on all platforms. Let me tell you how the code coverage works in NetBeans - we simply only run PHPUnit script with code coverage on. AFAIK PHPUnit uses XDebug to get this information so if your XDebug is not working properly, the code coverage won't be collected. If it is collected, then NetBeans just parses this file and mark the appropriate lines inthe editor. (In reply to comment #25) > If I create project on disk C: (my system disk), code coverage works. > If I create project on disk D:, code coverage doesn't work. This is _very_ weird; don't you have any whitespaces in your path, for example? Láďo, could you please try to reproduce? Thanks a lot. (In reply to comment #27) > Perhaps this info will help: my project files are on a different drive than the Netbeans files (I mention this since Slevin found out that this might be > a reason for code coverage not working). So it means that the "nbproject" directory is on different drive than your project's PHP files, right? Láďo, again, could you please try to reproduce? > Code coverage does work before I've updated my WampServer and Netbeans - even > if the project files had been in a different directory. If one uses these all-in-one packages (Wamp, Mamp etc.), one also _needs_ to be sure that its setup is OK; I mean all the php.ini files (one can be for Apache, another for CLI), all the PHP Include Paths etc. So, if anyone can reproduce this issue (with all-in-one package), please do so and let us know your setup, steps to reproduce. Or, if anyone has reliable steps to reproduce (as I have cited above), please provide them, we will try to reproduce and fix. Also, if anyone can reproduce, follow steps provided in comment #1 and attach the log files. For now closing as WORKSFORME since I cannot reproduce on Linux, sorry. Thanks for your cooperation.
Ok, I can reproduce on my Windows machine, just tell me where can I take log files to attach this bug.
(In reply to comment #31) > (In reply to comment #25) > > If I create project on disk C: (my system disk), code coverage works. > > If I create project on disk D:, code coverage doesn't work. > > This is _very_ weird; don't you have any whitespaces in your path, for example? > Láďo, could you please try to reproduce? Thanks a lot. That's actually the bug in PHP_CodeCoverage package. https://github.com/sebastianbergmann/php-code-coverage/issues/93
(In reply to comment #32) > Ok, I can reproduce on my Windows machine, just tell me where can I take log > files to attach this bug. I wrote it in my last comment: > Also, if anyone can reproduce, follow steps provided in comment #1 and > attach the log files.
Closing back as WORKSFORME and please, do not reopen this issue again since there are more independent reports here. Simply submit a new bug and follow instructions provided in the comment #1. Thanks for your cooperation.