-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No reports or PHPUnit coverage #147
Comments
Can you verify this behavior with the latest code base from git? Particularly commit 22bc153 might have fixed that.
That's unfortunately a bad commit from my development state that shouldn't have made it into a release. The report link should have been commented out as I'm still busy writing the report generator part. |
No luck :( Here's the output from the phpDox command:
|
Sorry for the long delay. If your problem still exists, I'd like you to enable the xml output engine and drop me one of the generated xml files (Important: Not the workdir version but the xml output engine file as that is the one that is enriched!). Make sure you pick a unit you consider covered by tests. In case you have privacy concerns, feel free to send me the file by email and/or remove the majority of methods as mainly the enrichment section is important. |
I had the same problem and the following fix worked for me ...
... to ...
... definately not the "right" solution but it works for me at the moment and might at least point you in the right direction. |
That "fix" confuses me as it would imply that the phpunit code coverage xml would have the full path in every directory node whereas it is only supposed to be the name of the directory itself. So your solution would only work if you do not have any sub-directories resulting basically in having the for-each loop only do one iteration. A reason why this might happen and your solutions works in said case though is that the base directories differ: Assuming phpDox would exclude say "src" from /some/path/src as base and phpunit's coverage report includes it, the entry point used within phpDox would of course be wrong. Can you verify if that is the case? |
This is what happens in my setup ... phpUnit generates ...
... but phpDox looks for ...
... which it can't find. (and yes, my "fix" only worked with flat dir. structure.) If I instead change src/generator/enricher/phpunit/PHPUnit.php line 84 to ...
... phpDox works fine with subdirs.) |
Also getting this with https://github.com/parsingphase/enigma-simulator/tree/phpdox-no-coverage - run Then compare docs/coverage/index.html (note the 'zero coverage' for classes / traits though... is that the source?) with docs/html/classes.xhtml. Afraid this isn't exactly a minimal example, but it should at least demonstrate the issue. Or may just work for you, who knows? |
No, it's nothing to do with PhpUnit's strict requirement for 100% testing, I've just shunted one of my classes to 100% testing and it still shows as 'untested' in the PhpDox output. |
The definition if something is considered "tested" by phpDox is based on the following logic:
As no test info is found, the units are marked UNTESTED. The problem though is laying within the path definitions. phpDox currently makes the (obviously sometimes invalid) assumption its source directory and the one used by PHPUnit are identical. Thank you for providing the test repository, as it showcases the problem quite nicely: phpDox is configured to use ${basedir}/src as its source while PHPUnit's coverage report starts at ${basedir}/src/Phase/Enigma. That also explains why the previously mentioned workarounds fixes the problem. I'll investigate with @sebastianbergmann on why that actually is and how to fix it best / synchronize the behaviors. In worst case I'll add another config option to phpDox's enriching renderer. |
Thanks @theseer, that's much appreciated. For the moment I'll see if I can adjust my paths to keep my own project happy, but I'll leave the phpdox-no-coverage tag in there so that the Enigma repo continues to be useful as a test environment. |
I can confirm that revising the path in phpdox.xml works:
|
👍 same issue |
Same here. I cannot seem to make a path that both doesn't have an error and seems to do anything to the output. Everything is still "untested" even though the entire codebase has 100% coverage. As a side note, is it possible to enrich with coverage from the output of multiple phpunit runs? |
Changed path resolution (Fixes issue #147)
The fix supplied should make the previously mentioned workaround superfluous. |
dev-master 96317ac gives me code coverage in the phpdox output, but no reports tab (is that still supposed to be generated?), with |
@parsingphase Thank you for testing it. The reports tab shouldn't have made it into the release as it was only there for a PoC implementation of the reports subsystem. I removed the code for that though as I was unhappy with the design and will re-implement it. |
Excellent, thanks. |
@theseer I am using phpcov to merge coverage reports for other reports like clover, html and crap4j output. I haven't seen that there's any option that will merge the coverage reports into junit xml. Is there another tool or technique I should be using? |
@sebastianbergmann any pointers? ;-) |
I consider this issue fixed. |
For tracking purposes: the issue for the phpcov feature request is sebastianbergmann/phpcov#27 |
When I run phpdox 0.6.6 I have two problems:
1 - No information from the PHPUnit enricher
Next to all of my classes it just says UNTESTED. I have PHPUnit 4.1, and its code coverage xml files are in
build/coverage/xml
and the relevant portion on myphpdox.xml
isI get no errors thrown when I run phpdox.
2 - Broken Reports link
The top navbar link for reports goes to an ungenerated file. I'm not sure what is supposed to be in that file, but neither a
reports.html
nor areports/index.html
are generated.The text was updated successfully, but these errors were encountered: