Drupal 8 - code coverage 0 % , i need suggestions how to resolve (attached logs, sonar-properties)

Hi, we are developing Drupal-php application code.
static code quality we are using sonarqube 8.6: Community edition as Docker container
Sonar scanner using 4.2

issue is code average is 0%
what are we missed, where i have to configure missing xml files

Error logs :

  1. WARN: PHPUnit xml test report not found: tests-report.xml
    WARN: PHPUnit xml coverage report not found: coverage-report.xml

  2.  'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations:              
        target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
    

my Sonar-project-properties file
sonar.projectKey=org.dev.portal
sonar.projectName=org.dev.portal
sonar.projectVersion=8.0

#sonar.php.coverage.reportPath=phpunit.coverage.xml
#sonar.php.tests.reportPath=phpunit.xml

sonar.projectDescription=org-php-sonar

#sonar.sources=php

sonar.sources=src
sonar.exclusions=bin

#sonar.tests=tests

.
#sonar.tests=**/tests/*

sonar.language=php,js

sonar.sourceEncoding=UTF-8

sonar.php.file.suffixes=php,inc,module,install

PHPMD (not used currently)

sonar.phpPmd.analyzeOnly=true
sonar.phpPmd.reportPath=logs/php-md.xml

PHP CodeSniffer (not used currently)

sonar.phpCodesniffer.analyzeOnly=true
sonar.phpCodesniffer.reportPath=logs/codesniffer.xml

Reusing PHPUnit reports

sonar.php.coverage.reportPath=ci/codeCoverage/codeCoverage.xml
sonar.php.tests.reportPath=ci/testResults.xml

##sonar.analysis.mode=preview
sonar.issuesReport.html.enable=true
sonar.report.export.path=report.json

Set timeouts much longer.

sonar.phpDepend.timeout=480
sonar.phpPmd.timeout=480
sonar.phpCodesniffer.timeout=480
sonar.phpUnit.timeout=240

Files to exclude

sonar.exclusions=/vendor/,/tests/,/node_modules/,/core/

sonar.phpDepend.argumentLine=–ignore=vendor,tests --exclude=vendor,tests
sonar.phpPmd.argumentLine=–exclude vendor,tests

sonar.phpCodesniffer.argumentLine=–ignore=vendor,tests

Hey there.

This should be sonar.php.tests.reportPath**s** (documented here)

And of course, you should make sure a code coveerage report actually exists at ci/codeCoverage/codeCoverage.xml

FWIW, these analysis parameters are probably having zero effect and should be removed. Kill the noise :slight_smile: