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 251351

Summary: Empty code coverage report if project is not on the same harddrive as NetBeans IDE
Product: php Reporter: xantiva <xantiva>
Component: PHPUnitAssignee: Tomas Mysik <tmysik>
Status: RESOLVED WONTFIX    
Severity: normal CC: vriha
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: nb-phpunit-coverage.xml
nb-phpunit-log.xml

Description xantiva 2015-03-21 20:28:50 UTC
I want to see the code coverage of my unit tests, performed with PHPUnit, but the code coverage report is always empty / 0,0%:

"No data -- have you run your code yet?"


Searching around, I found this old blog entry:

https://jdhnet.wordpress.com/2013/12/10/empty-code-coverage-report-after-running-unit-tests-in-netbeans/

The code coverage report works only, if NetBeans and the project are on the same harddrive!

My normal environment is NetBeans on C: and the projects, xampp with phpunit on E:. With the project on E: the code coverage report left empty. If I copy the project to C: and execute the test, the code coverage report works as expected.
Comment 1 Tomas Mysik 2015-04-27 10:20:11 UTC
Please, reproduce your problem, copy the command from the Output window and run it manually. Then reopen this issue and atach both PHPUnit log files ("--log-junit" and "--coverage-clover").

Thanks.
Comment 2 Tomas Mysik 2015-04-27 10:22:39 UTC
BTW both files [1][2] should be found in your TEMP directory once you reproduce your problem.

Thanks.
[1] nb-phpunit-log.xml
[2] nb-phpunit-coverage.xml
Comment 3 Tomas Mysik 2015-04-27 10:23:26 UTC
@vriha: Please try to reproduce this issue and attach PHPUnit log files (see my previous comments).

Thanks.
Comment 4 xantiva 2015-04-27 19:37:07 UTC
Created attachment 153417 [details]
nb-phpunit-coverage.xml
Comment 5 xantiva 2015-04-27 19:37:29 UTC
Created attachment 153418 [details]
nb-phpunit-log.xml
Comment 6 xantiva 2015-04-27 19:39:02 UTC
Hi Tomas,

I attached the files. Here is also the content from the output window:


"E:\xampp\bin-phar\phpunit.cmd" "--colors" "--log-junit" "C:\Users\Mike\AppData\Local\Temp\nb-phpunit-log.xml" "--coverage-clover" "C:\Users\Mike\AppData\Local\Temp\nb-phpunit-coverage.xml" "C:\Users\Mike\AppData\Roaming\NetBeans\8.0\phpunit\NetBeansSuite.php" "--run=E:\dev\SoftConnect\trunk\Tests\Xantiva"

E:\dev\SoftConnect\trunk\Tests>php "E:\xampp\bin-phar\phpunit.phar" --colors --log-junit C:\Users\Mike\AppData\Local\Temp\nb-phpunit-log.xml --coverage-clover C:\Users\Mike\AppData\Local\Temp\nb-phpunit-coverage.xml C:\Users\Mike\AppData\Roaming\NetBeans\8.0\phpunit\NetBeansSuite.php --run=E:\dev\SoftConnect\trunk\Tests\Xantiva  
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.

Configuration read from E:\dev\SoftConnect\trunk\Tests\phpunit.xml

.......................................................

Time: 9.21 seconds, Memory: 12.00Mb

OK (55 tests, 101 assertions)

Generating code coverage report in Clover XML format ... done
Done.


Best regards,
Mike
Comment 7 Vladimir Riha 2015-04-28 06:19:10 UTC
I can reproduce it as well, code coverage xml looks identical in my case to the one from @xantiva, test results are displayed OK in NetBeans



Product Version: NetBeans IDE Dev (Build 201504280001)
Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 8 Vladimir Riha 2015-04-28 06:21:29 UTC
For the record I used latest PHPUnit from

https://phar.phpunit.de/phpunit.phar
https://phar.phpunit.de/phpunit-skelgen.phar
Comment 9 Tomas Mysik 2015-04-28 07:24:27 UTC
So, from the attached files it is clear that the problem is in PHPUnit - its coverage log file contains no data [1]; compare it to the other log file where all the data with results are available. You will likely need to report a bug directly against PHPUnit.

Thanks for reporting.
[1] <metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
Comment 10 xantiva 2015-04-28 22:11:35 UTC
Thanks for your work. I added an issue at PHPUnit (Github):

https://github.com/sebastianbergmann/phpunit/issues/1698
Comment 11 Tomas Mysik 2015-04-29 05:10:15 UTC
(In reply to xantiva from comment #10)
> Thanks for your work. I added an issue at PHPUnit (Github):
> 
> https://github.com/sebastianbergmann/phpunit/issues/1698

Thanks a lot!