Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Junit reporter doesn't include project root in output #5088

Closed
6 tasks done
jrnail23 opened this issue Jan 31, 2024 · 2 comments · Fixed by #5116
Closed
6 tasks done

Junit reporter doesn't include project root in output #5088

jrnail23 opened this issue Jan 31, 2024 · 2 comments · Fixed by #5116

Comments

@jrnail23
Copy link

jrnail23 commented Jan 31, 2024

Describe the bug

As originally reported in #2566, but not quite resolved in #256 as anticipated, in a monorepo / multi-workspace setup, the Junit reporter does not include the project root in its output (see example below)

Here, this testsuite is in... well... damn, I don't know which project it's in, because the testsuite.name attribute is relative. It should be something like packages/my-package/tests/index.test.ts.

<?xml version="1.0" encoding="UTF-8" ?>
<testsuites name="vitest tests" tests="67" failures="0" errors="0" time="1.636">
    <testsuite name="test/index.test.ts" timestamp="2024-01-31T22:24:19.411Z" hostname="MacBook-Pro-M1.local" tests="1" failures="0" errors="0" skipped="0" time="0.016">

Reproduction

(no repro -- reporting a previously closed bug)

System Info

System:
    OS: macOS 13.6.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 213.03 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.asdf/installs/nodejs/18.16.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.5.1 - ~/.asdf/plugins/nodejs/shims/npm
    Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 121.0.6167.85
    Firefox: 122.0
    Safari: 16.6
  npmPackages:
    @vitest/coverage-v8: ^1.2.2 => 1.2.2 
    vitest: ^1.2.2 => 1.2.2 

Used Package Manager

npm

Validations

@sheremet-va
Copy link
Member

I see what you mean. I guess it should be relative to the root config instead of a project one.

@jrnail23
Copy link
Author

If it's any help, I'm also using vitest-sonar-reporter, and that one uses the root properly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants