-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add JUnit reporter #586
base: main
Are you sure you want to change the base?
Add JUnit reporter #586
Conversation
</testsuite> | ||
<testsuite name="Unlisted dependencies" tests="2" failures="2"> | ||
<testcase tests="1" failures="1" name="Unlisted dependencies" classname="src/index.ts"> | ||
<failure message="Unlisted dependencies - unresolved" type="Unlisted dependencies">Unlisted dependencies: "unresolved" inside src/index.ts</failure> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know anything about this format, but will each issue be in its own node, or should it be? This example gives me the impression that all unlisted dependencies will end up in this single node? Or will each one have the "Unlisted dependencies: " prefix?
Maybe you could show an example of how it looks like in the CI environment (eg. Bitbucket)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. I've already used this junit reporter during development and tested it with configured Bitbucket. I'll gather some real-life data and post it here for further discussion.
3691e5b
to
9bf286f
Compare
13ba313
to
28f05f0
Compare
Is there still interest in wrapping up this pull request? |
This is the actual output from junit reporter on Bitbucket pipelines run on the live project: And this is part of the output xml file that was reported after running knip (in txt because Github won't allow to attach xml file). I've cut some sensitive data from the file (that's why issues count don't match with the image from BB). |
d692d08
to
7aa2f6d
Compare
👷 Deploy request for knip pending review.Visit the deploys page to approve it
|
I feel like we could improve the output a bit. For instance, I see this in one section:
Maybe all unused devDependencies of a file can go into a single foldout, without the duplication? Eg:
Doesn't need to be perfect, but I wonder how close we can get to something more like this? |
I need to test if BitBucket will accept something like that <testsuite name="Unused dependencies" tests="1" failures="4">
<testcase tests="1" failures="4" name="Unused dependencies" classname="package.json">
<failure message="Unused dependencies - @types/google.accounts" type="Unused dependencies">Unused dependencies: "@types/google.accounts" inside package.json</failure>
<failure message="Unused dependencies - fast-xml-parser" type="Unused dependencies">Unused dependencies: "fast-xml-parser" inside package.json</failure>
<failure message="Unused dependencies - type-fest" type="Unused dependencies">Unused dependencies: "type-fest" inside package.json</failure>
<failure message="Unused dependencies - web-vitals" type="Unused dependencies">Unused dependencies: "web-vitals" inside package.json</failure>
</testcase>
</testsuite> or other similar output. If yes, then more compact output without duplications should be possible. |
300ed3d
to
fe1168b
Compare
d91d007
to
d4121d9
Compare
e7b061a
to
847649d
Compare
Closes #568
PR aims to implement a reporter for generating JUnit xml. Without
--reporter-options
it will output the results to the console. By providingpath
value, the reporter will try to put the output into the file.Added small "fast-xml-parser" package to the knip package.
Also updated the docs with info about Junit reporter.