19 Replies Last post: Mar 6, 2012 11:37 AM by Nikolay Matveev  
Edgar Martinez Novice 102 posts since
Jun 17, 2011
Currently Being Moderated

Feb 26, 2012 6:04 AM

New Code Coverage Tool EAP PS-114.1158

So I am think I configured the code coverage tool properly. My tests are run with the new code coverage button in EAP PS-114.1158 but the report says no lines ar covered event though the tests are run and they pass

I dont have PHPUnit outputting a clover file, Should I have it output a file whent he tests are run?

In other words do i still need to have PHPUnit write a clover report whent he tests are run?

uncovered.PNG

 

Not sure why it says uncovered? even though it clearly is covered and passes the tests.

I'm on windows 7, using PHPStorm EAP PS-114.1158

Andriy Bazanov Master 3,990 posts since
May 28, 2010
Currently Being Moderated
Feb 26, 2012 7:14 AM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.1158

The coverage report (xml file) is not properly generated on Windows (wrong paths to the files).

 

http://youtrack.jetbrains.com/issue/WI-9418

 

If you generate coverage xml file using phpunit console command and then tell PhpStorm to use that report (Ctrl+Alt+F6) you will see proper results.

 

P.S.

Interesting build number ... you are way ahead of all of us

Nikolay Matveev Apprentice 697 posts since
Apr 14, 2010
Currently Being Moderated
Feb 27, 2012 4:06 PM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.1158

Hello Edgar,

 

Do you still have the issue?

 

Thank you for feedback!

Nikolay Matveev Apprentice 697 posts since
Apr 14, 2010
Currently Being Moderated
Mar 6, 2012 11:37 AM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.1158

Edgar,

 

Only thing I would add is the same thing that Andriy Bazanov said and that is add some way to remove the Tests folder from code coverage.

Could you please submit an usability problem (it is actual for Zend Debugger only) http://youtrack.jetbrains.com/issues/WI#newissue=yes?

 

Thank you for feedback!

Nikolay Matveev Apprentice 697 posts since
Apr 14, 2010
Currently Being Moderated
Feb 27, 2012 4:05 PM in response to: Andriy Bazanov
Re: New Code Coverage Tool EAP PS-114.1158

Andriy,

 

The coverage report (xml file) is not properly generated on Windows (wrong paths to the files).

 

http://youtrack.jetbrains.com/issue/WI-9418

It is not about this case - Edgar uses Zend Debugger (Zend Debuggger and Xdebug code coverage implemented in different way)

 

Thank you for feedback!

Nikolay Matveev Apprentice 697 posts since
Apr 14, 2010
Currently Being Moderated
Feb 28, 2012 2:04 PM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.1158

Edgar,

 

Please provide a screenshot of your PHP interpeter configuration ('Project Settings' -> 'PHP'), command line which PhpStorm generates for running tests with coverage and your phpinfo output (you can get it from 'Project Settings -> PHP' also).

 

Thank you for feedback!

Nikolay Matveev Apprentice 697 posts since
Apr 14, 2010
Currently Being Moderated
Mar 5, 2012 7:59 PM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.1158

Edgar,

 

Finally I have reproduced the issue. You need to enable 'zend_debugger.enable_coverage' option in your configuration file (Should be here: 'C:\zend\ZendServer\etc\cfg\debugger.ini').


Please let me know if it will help you or not.

 

Thank you for feedback!

Andriy Bazanov Master 3,990 posts since
May 28, 2010
Currently Being Moderated
Feb 28, 2012 5:23 PM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.1158

1) When you run tests with "Coverage" button, PhpStorm will use it's own clover.xml file, so your one should be ignored (at least this is how it works for me here) -- can you look what the command is get's executed (command line) and post it here?

 

2) That PhpStorm's own clover.xml should be named like PROJECTNAME$RUNNAME.xml (in your case I think it will be Lestat$All.xml and should be located in C:\Users\USERNAME\.WebIde40\system\coverage. Can you show the content of it?

 

I don't know what exactly does not work for you (since you are using Zend Debugger while I have Xdebug), but I do not even see that dialog poping up asking what to do with new coverage data (merge, ignore, replace).

 

And yes -- I also think that the coverage data is cached.

Andriy Bazanov Master 3,990 posts since
May 28, 2010
Currently Being Moderated
Feb 28, 2012 8:06 PM in response to: Edgar Martinez
Re: New Code Coverage Tool EAP PS-114.158

Well ... the file you provided clearly shows that you have no lines covered (for whatever reason) for your files (count="0" all the time):

  • C:\zend\Apache2\htdocs\Lestat\lestat\Lestat_Core.php
  • C:\zend\Apache2\htdocs\Lestat\lestat\LFactory.php

 

TBH, this xml file is one big mess (compared to what I have here, of course). It contains references to tests files themselves plus PHPUnit own files. It should not contain those files -- they supposed to be automatically blacklisted and removed from the report.

 

I suggest Ctrl+Alt+F6 and use "delete/minus" button to remove old data and then try again -- maybe it merges all previous runs together or whatever.

 

I have found the reason and workaround for my own issue (why it does not work for me) -- hopefully there is something simple in your case as well.

More Like This

  • Retrieving data ...