AriPerkkio / vitest-sonar-reporter

SonarQube reporter for Vitest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monorepo path issue

GiannisGialamas opened this issue · comments

Hi,

There is an issue with the file contents path in line 40 when the package is being used in a monorepo. The problem is that the path generated within the package only, rather than a full relative path. This results in SonarQube throwing the following errors:


123012:32:53.502 INFO: Imported test execution data for 0 files
123112:32:53.503 INFO: Test execution data ignored for 12 unknown files, including:
1232 tests/components/foo.spec.ts
1233 tests/components/bar.spec.ts


To resolve this issue, you may want to consider modifying the path to generate a full relative path that includes the monorepo directory. This should ensure that SonarQube is able to properly import the test execution data.

With best regards,
Ioannis

Could you provide a minimal reproduction case for this? I'll need to see vitest.config.ts and location of the test files to understand what is happening there.

The current behaviour should match with Vitest's internal reporters. You should be seeing identical paths when using json or junit reporters for example.

There's now a reproduction setup in #78 and root cause is identified.

@GiannisGialamas this is now fixed in v0.4.1.