SonarQube PHP
  1. SonarQube PHP
  2. SONARPHP-18

phpunit command generation depends on maven project name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Running mvn sonar:sonar with sonar.dynamicAnalysis=true generates the following phpunit command

      'phpunit.bat --log-junit=$

      {basedir}\target\logs\phpunit.xml --coverage-clover=${basedir}

      \target\logs\ <mavenProjectName> <testDir>

      where mavenProjectName is the value of project>name tag
      and testDir is the value of project>properties>sonar.phpUnit.mainTestClass tag
      of the pom.xml file

      Removing mavenProjectName (from phpunit command line) would make multiple tests files projects working.

        Issue Links

          Activity

          Hide
          Mathias kluba added a comment -

          please remove the execution of tools in the Sonar plugin.
          the sonar plugin should depends on the php-maven-plugin: http://www.php-maven.org/phpunit-mojo.html
          So unit tests should be executed by "php:unit"

          It's better to have "execution of tools" inside the php-maven-plugin, because you can execute these tools without sonar (in Hudson for example).

          .Net plugin do it like that:

          It will also reduce the support, because you will fix bugs in one place only (instead of fixing phpunit plugin in Sonar AND php-maven-plugin)

          Show
          Mathias kluba added a comment - please remove the execution of tools in the Sonar plugin. the sonar plugin should depends on the php-maven-plugin: http://www.php-maven.org/phpunit-mojo.html So unit tests should be executed by "php:unit" It's better to have "execution of tools" inside the php-maven-plugin, because you can execute these tools without sonar (in Hudson for example). .Net plugin do it like that: Sonar plugin: http://docs.codehaus.org/display/SONAR/.Net+plugin maven-dotnet-plugin: http://maven-dotnet-plugin.appspot.com/ It will also reduce the support, because you will fix bugs in one place only (instead of fixing phpunit plugin in Sonar AND php-maven-plugin)
          Hide
          Evgeny Mandrikov added a comment -

          Hi Mathias,

          I didn't agree with your comment, because there are pros and cons in dependency on maven-plugin.
          Dependency on maven means that sonar-php-plugin will not work without Maven, but we are going to provide standalone Sonar runner - SONAR-2105.

          Moreover we are trying to decrease coupling with Maven - for example:

          Show
          Evgeny Mandrikov added a comment - Hi Mathias, I didn't agree with your comment, because there are pros and cons in dependency on maven-plugin. Dependency on maven means that sonar-php-plugin will not work without Maven, but we are going to provide standalone Sonar runner - SONAR-2105 . Moreover we are trying to decrease coupling with Maven - for example: sonar-taglist-plugin doesn't depend on taglist-maven-plugin any more - SONARPLUGINS-804 sonar-findbugs-plugin - SONAR-1772 sonar-checkstyle-plugin - SONAR-1536 sonar-pmd-plugin - SONAR-1542
          Hide
          Akram Ben Aissi added a comment -

          I agree with the fact that coupling with other maven plugin should be maintained as low as possible.
          For the first part of the issue, it was solved in SONARPLUGINS-748.

          Show
          Akram Ben Aissi added a comment - I agree with the fact that coupling with other maven plugin should be maintained as low as possible. For the first part of the issue, it was solved in SONARPLUGINS-748 .
          Hide
          Akram Ben Aissi added a comment -

          it was solved in SONARPLUGINS-748.

          Show
          Akram Ben Aissi added a comment - it was solved in SONARPLUGINS-748 .

            People

            • Assignee:
              Akram Ben Aissi
              Reporter:
              Anonymous
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: