PHPUnit test coverage from PHPUnit not being picked up with. Giving Project:null error
This post has NOT been accepted by the mailing list yet.
Hello, I'm currently running a few tests on PHPUnit 4.2.5. I'm generating the clover reports as per the Sonar docs, and I'm passing them to sonar through the sonar project properties and here's the output:
[exec] Time: 6.98 seconds, Memory: 20.75Mb
[exec] OK (7 tests, 18 assertions)
[exec] Generating code coverage report in Clover XML format ... done
So this file gets generated and looks more or less well formed when I open it and take a look. When I call Sonar runner I get this on Jenkins:
15:55:42.153 INFO - Sensor PHPUnit Sensor...
15:55:42.153 INFO - Analyzing PHPUnit tests report: tools/phing/build/logs/phpunit.integration.xml
15:55:42.277 INFO - Analyzing PHPUnit coverage report: tools/phing/build/coverage/phpunit-xml-coverage.xml
15:55:43.312 INFO - Project: null
15:55:43.368 INFO - Sensor PHPUnit Sensor done: 1215 ms
And of course Sonar doesn't pick up the coverage, but picks up the unit tests just fine. Here's my configuration for sonar atm:
# Path to source directories (required)
# (All paths are relative to Jenkins' 'workspace').
# I originally included all the Drupal source, but PHP Depend would suck up all
# the memory on the system and fail when there were more than ~300 files.
# The language of the project.
# Encoding of the source code
# File suffixes to check
# Files to exclude
# To deactivate features related to unit tests execution and coverage
I read a post from a while ago mentioning that it may have trouble with lots of different test files which seems incorrect. Either way I updated PHPUnit from 3.7 to 4.2 at the advice of the post but this did not solve the issue though it did make my tests slightly better.