Problems with test execution and coverage upload

Greetings

We have recently started using the sonar scanner to get some info on our project codebase. The particular project is a .NET Core 3.1 web app using React.js as an SPA frontend.

We run unit tests with NUnit on the .net side and Jest for the react/typescript side.

I have been fighting with the configuration now for some time to get our test execution and coverage data on the server but haven’t had luck yet.

For out specific sonar server, we have a developer edition that is Version 8.1 (build 31237). I have followed the following user guide:
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/

the project structure is as follows:

root
|-client-app
   |-src  //client side react code
   |-tests // client unit tests via Jest
|-src // backend code in C#
|-tests // nunit test project with unit tests

I have used the command dotnet tool install --global dotnet-sonarscanner to make the scanner available to me. Next I have used the following commands in the root directory to generate an analysis:

dotnet sonarscanner begin `
		/k:project-key `
		/d:sonar.branch.name=tests `
		/d:sonar.modules=frontend,backend `
		/d:frontend.sonar.sources=client-app/src `
		/d:frontend.sonar.testExecutionReportPaths=test-results/jest-report.xml `
		/d:frontend.sonar.javascript.lcov.reportPaths=test-results/jest-coverage/lcov.info `
		/d:frontend.sonar.tests=client-app/tests `
		/d:frontend.sonar.test.inclusions=*.test.tsx `
		/d:frontend.sonar.inclusions=*.tsx `
		/d:frontend.sonar.sourceEncoding=utf-8 `
		/d:backend.sonar.cs.nunit.reportsPaths=test-results/dotnet-report.xml `
		/d:backend.sonar.cs.opencover.reportsPaths=test-results/dotnet-coverage/coverage.xml `
		/d:backend.sonar.tests=tests `
		/d:backend.sonar.test.inclusions=*Tests.cs `
		/d:backend.sonar.sources=src `
		/d:backend.sonar.inclusions=*.cs `
		/d:backend.sonar.sourceEncoding=utf-8

	npm test --prefix ./client-app/

	dotnet test `
		/p:AltCover=true `
		/p:AltCoverXmlReport=../test-results/dotnet-coverage/coverage.xml `
		--test-adapter-path:. `
		--logger:"nunit;LogFilePath=../test-results/dotnet-report.xml"
	dotnet sonarscanner end

The test results get generated by several tools:

  • for the frontend, Jest generates an execution report with the jest-sonar-reporter npm package and generates a jest-report.xml as an execution report, and an lcov report on coverage
  • for the backend, nunit uses the NunitXml.TestLogger library and generates coverage.xml and dotnet-report.xml

the resulting structure of reports is this:

root
|-test-results
| |-dotnet-coverage
| | |-coverage.xml
| |-jest-coverage
|   |-lcov-report/
|   |-lcov.info
|-dotnet-report.xml
|-jest-report.xml

Looking at the configuration I have setup, all of the information should be uploaded correctly but unfortunately isn’t. I was hoping someone would point me to a mistake I have made in configuration. If not, I am able to provide outputs generated by the commands executed in order to help detect what the problem is.