So my case is next. We are using some sort of custom templating engine that contains normal HTML syntax and some custom tags and among other it can contain some sort of scripting that is executed on the server side. We wrote some unit tests that prove the content of those custom templates and raise error when there are some script elements used that are forbidden. We are using Jest as test runner and we are creating Sonar Qube test report with jest-sonar-reporter
. I have set sonar.tests
to point to our tests as sonar.tests=spec
. In Sonar Qube UI under Administration > Web area, I have extended sonar.web.file.suffixes
with our extension as well. When we start Sonar Qube in our deployment pipeline, I see in the logs
07:08:49.291 INFO: Sensor Generic Test Executions Report
07:08:49.291 WARN: Property 'sonar.genericcoverage.unitTestReportPaths' is deprecated. Please use 'sonar.testExecutionReportPaths' instead.
07:08:49.291 INFO: Parsing /codebuild/output/src915641274/src/reports/test-report.xml
07:08:49.491 INFO: Imported test execution data for 0 files
07:08:49.491 INFO: Test execution data ignored for 2 unknown files, including:
/codebuild/output/src943613774/src/spec/isml.spec.js
/codebuild/output/src943613774/src/spec/files.spec.js
Our sonar-project.properties look like this:
sonar.host.url=<host_url>
sonar.login=<token>
sonar.projectKey=<project_key>
sonar.projectName=<project_name>
sonar.sources=cartridge,spec
sonar.verbose=true
sonar.inclusions=**/js/**/*.js,**/templates/**/*.isml
sonar.tests=spec
sonar.testExecutionReportPaths=reports/test-report.xml
In this project I have js
and web
as languages. If I go in Sonar Qube UI and check this project under Measures > Coverage > Tests, I do not see any coverage tests being imported. So my question is did I understand the JUnit coverage import wrong or am I missing something in my Sonar Qube configuration?
Best regards.
Aucun commentaire:
Enregistrer un commentaire