Skip to content

Error parsing #262

@NicolasGuruphat

Description

@NicolasGuruphat

Hello,
I am getting this error from sonarqube while using this package with a Vue 3 project :
ERROR Error during parsing of generic test execution report '/builds/my-project/sonar-report.xml'. Look at the SonarQube documentation to know the expected XML format.
I do not understand where is the problem as the report look exactly like the one expected from sonarqube.

The report

<?xml version="1.0" encoding="UTF-8"?>
<testExecutions version="1">
  <file path="mypath.ts">
    <testCase name="example" duration="4" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="0" />
    <testCase name="example" duration="0" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="0" />
  </file>
  <file path="mypath.ts">
    <testCase name="example" duration="134" />
    <testCase name="example" duration="56" />
    <testCase name="example" duration="41" />
    <testCase name="example" duration="37" />
    <testCase name="example" duration="26" />
    <testCase name="example" duration="16" />
    <testCase name="example" duration="19" />
  </file>
  <file path="mypath.ts">
    <testCase name="example" duration="14" />
    <testCase name="example" duration="4" />
    <testCase name="example" duration="106" />
    <testCase name="example" duration="28" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="19" />
    <testCase name="example" duration="46" />
  </file>
  <file path="mypath.ts">
    <testCase name="example" duration="5" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="0" />
    <testCase name="example" duration="29" />
    <testCase name="example" duration="1" />
    <testCase name="example" duration="0" />
  </file>
</testExecutions>

sonar-project.properties

sonar.testExecutionReportPaths=sonar-report.xml

vite.config.ts :

  test: {
    reporters: [
            'default', 
            ['vitest-sonar-reporter', { outputFile: 'sonar-report.xml' }],
        ],

thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions