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

XUnit parser #84

Closed
HeidiRechek opened this issue Feb 27, 2020 · 11 comments
Closed

XUnit parser #84

HeidiRechek opened this issue Feb 27, 2020 · 11 comments

Comments

@HeidiRechek
Copy link

HeidiRechek commented Feb 27, 2020

npx violation-comments-to-bitbucket-cloud-command-line -username *** -password *** -ws ***** -rs jenkins_test -prid 43 -v "JUNIT" "." ".*/reports/mocha-test-results.xml$" "Junit" -keep-old-comm
ents true
Feb 27, 2020 10:42:00 AM se.bjurr.violations.lib.parsers.JUnitParser parseReportOutput
WARNING: Found failure, but failed to find fail line from stacktrace

@tomasbjerre
Copy link
Owner

Can you attach the mocha-test-results.xml file?

@HeidiRechek
Copy link
Author

mocha-test-results.txt

@HeidiRechek
Copy link
Author

Second example:
npx violation-comments-to-bitbucket-cloud-command-line -username **** -password **** -ws ***** -rs jenkins_test -prid 43 -v "JUNIT" "." "./reports/stylelint-test-results.xml$" "Junit" -keep-old-
comments true
Feb 27, 2020 10:48:26 AM se.bjurr.violations.lib.reports.Parser findViolations
SEVERE: Error when parsing C:\Github\jenkins_test\org_
.\reports\stylelint-test-results.xml as JUNIT
java.lang.RuntimeException: "classname" not found in "
On line 3, column 1 in C:\Github\jenkins_test\org_
\cartridges\org_***\cartridge\client\default\scss\homePage.scss
"
at se.bjurr.violations.lib.util.ViolationParserUtils.getAttribute(ViolationParserUtils.java:72)
at se.bjurr.violations.lib.parsers.JUnitParser.parseReportOutput(JUnitParser.java:32)
at se.bjurr.violations.lib.reports.Parser.findViolations(Parser.java:115)
at se.bjurr.violations.lib.ViolationsApi.violations(ViolationsApi.java:58)
at se.bjurr.violations.main.Runner.main(Runner.java:185)
at se.bjurr.violations.main.Main.main(Main.java:6)

stylelint-test-results.txt

@HeidiRechek HeidiRechek reopened this Feb 27, 2020
@tomasbjerre
Copy link
Owner

Actually, XUnit is not implemented. But can be, I'll consider this a feature request.

Note to self:

@tomasbjerre tomasbjerre changed the title Unable to parse JUnit. XUnit parser Feb 27, 2020
tomasbjerre added a commit that referenced this issue Mar 3, 2020
tomasbjerre added a commit to tomasbjerre/violation-comments-to-bitbucket-cloud-command-line that referenced this issue Mar 3, 2020
@tomasbjerre
Copy link
Owner

Releasing a XUNIT parser now. Open issue again if any problems.

tomasbjerre added a commit to tomasbjerre/violation-comments-to-bitbucket-server-command-line that referenced this issue Mar 3, 2020
@HeidiRechek
Copy link
Author

I have updated and verified my local violation-comments-to-bitbucket-cloud-command-line is 1.16 but when I try command I get Exception in thread "main" java.lang.IllegalArgumentException: No enum constant

npx violation-comments-to-bitbucket-cloud-command-line -username ***** -password ***** -ws ****** -rs jenkins_test -prid 45
-v "CHECKSTYLE" "." "./reports/eslint-checks
tyle-results.xml$" "ESlint"
-v "XUNIT" "." ".
/reports/mocha-test-results.xml$" "XUnit"
-keep-old-comments true
Exception in thread "main" java.lang.IllegalArgumentException: No enum constant se.bjurr.violations.lib.reports.Parser.XUNIT
at java.lang.Enum.valueOf(Unknown Source)
at se.bjurr.violations.lib.reports.Parser.valueOf(Parser.java:57)
at se.bjurr.violations.main.Runner.main(Runner.java:181)
at se.bjurr.violations.main.Main.main(Main.java:6)

tomasbjerre added a commit to tomasbjerre/violation-comments-to-github-command-line that referenced this issue Mar 3, 2020
@tomasbjerre
Copy link
Owner

"It works on my machine" =)

npx violation-comments-to-bitbucket-cloud-command-line \
 -cocf false -csfc false -cocc false -ccwasfc true -username tomasbjerre -password asdasdasd  -ws tomasbjerre -rs violations-test -prid 1 \
 -comment-template "

-----------

`{{changedFile.filename}}`


**{{violation.rule}}**


{{violation.message}}


 "\
 -v "XUNIT" "." ".*txt$" "XUnit"

And result:
https://bitbucket.org/tomasbjerre/violations-test/pull-requests/1/some-crap/diff

@HeidiRechek
Copy link
Author

HeidiRechek commented Mar 3, 2020 via email

@tomasbjerre
Copy link
Owner

No it can be any filename.

@HeidiRechek
Copy link
Author

HeidiRechek commented Mar 3, 2020 via email

@tomasbjerre
Copy link
Owner

Yes

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

No branches or pull requests

2 participants