Coverlet tool for test coverage, pipeline crashed

Hello,

  • SonarQube 9.8
  • deployed from zip

Pipeline crashes with an error Job failed: exit code 1 and null result.

+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+
+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 0% | 0% | 0% |
+---------+------+--------+--------+
| Average | 0% | 0% | 0% |
+---------+------+--------+--------+

My pipeline job is:

sonarqube:
  stage: sonarqube
  image: mcr.microsoft.com/dotnet/sdk:6.0
  variables:
    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
    GIT_DEPTH: "0"
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  script:
    - "apt-get update"
    - "apt-get install --yes openjdk-11-jre"
    - "dotnet tool install --global coverlet.console"
    - "dotnet tool install --global dotnet-sonarscanner"
    - "export PATH=\"$PATH:$HOME/.dotnet/tools\""
    - "dotnet sonarscanner begin -k:\"$PROJECT_KEY\" -d:sonar.login=\"$SONAR_TOKEN\" -d:sonar.host.url=\"$SONAR_HOST_URL\" -d:sonar.cs.opencover.reportsPaths=coverage.xml"
    - "dotnet build --no-incremental"
    - coverlet .\CovExample.Tests\bin\Debug\net6.0\CovExample.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml"
    - "dotnet sonarscanner end -d:sonar.login=\"$SONAR_TOKEN\""

How to solve the error, help please!

Also in the $CI_RPOJECT_DIR/test folder there are five directories with tests but in the pipeline log I see the following after executing the coverlet command:

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
No test is available in $CI_PROJECT_DIR/test/Project.Host.UnitTests/bin/Debug/net6.0/Project.Host.UnitTests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

and there is nothing in the logs about the other four tests.

Hi,

This seems outside the scope of this community.

 
Ann

Hi,

Why? Explain, please

Hi,

This seems to be purely about your coverage tool crashing, not about SonarQube analysis. Coverlet is out of scope for us.

 
Ann