Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Not sure whether this a bug or just a feature that isn't implemented yet, or if I'm just doing something incorrectly, but currently I am not able to generate code coverage reports for test cases that don't make a web call. To reproduce, run unit test cases for a module, click on code coverage report, and view the Invalid coverage set message. I'm not sure how hard a feature this is to implement, but it seems like reporting coverage on unit tests and database tests is an important feature.
Comment | File | Size | Author |
---|---|---|---|
#1 | updated_code_coverage_patch.patch | 1.77 KB | Berdir |
Comments
Comment #1
BerdirCode that is run within the test is currently not tracked.
The attached patch updates the patch that comes with the module to add code coverage for test methods (and everything that is executed by them), note that you will need to re-apply that patch after applying the attached patch :)
Comment #2
BerdirNote that this means that the test execution time will increase quite a bit with this. And it's 30% slower (when limiting to a single module, probably much more when tracking everything) when also tracking the setUp() call, so I left that one out.
Please test.
Comment #3
boombatower CreditAttribution: boombatower commentedI just pushed a bunch of commits that were developed for ReviewDriven. I believe this is now fixed.