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 Output #160

Open
rodnaph opened this issue May 2, 2015 · 5 comments
Open

JUnit Output #160

rodnaph opened this issue May 2, 2015 · 5 comments

Comments

@rodnaph
Copy link

rodnaph commented May 2, 2015

I'm interested in running Eastwood inside a Jenkins build and having the results output for parsing by a post-build publisher (Junit seems to be the easiest to target).

At the moment the way support for parsing warning information is set up seems to be via using a text file with the :out parameter - is this how all planned integration should be achieved or would there be any interest in a patch for extensible output formatting?

@jafingerhut
Copy link
Collaborator

There are currently a few options for selecting the format of the output text. See the description of the :warning-format key here: https://github.com/jonase/eastwood#editor-support

If you would prefer a different text output format, let me know what you are looking for.

Eastwood can also be invoked from within a REPL, and either print its output as text, or return it as a sequence of maps with keys like :line :column :file etc. See here: https://github.com/jonase/eastwood#running-eastwood-in-a-repl

@rodnaph
Copy link
Author

rodnaph commented May 7, 2015

Hi Andy, yes I saw that option, but I'm looking to produce XML output from the result data and couldn't see how I would bend the line-by-line approach to create structured data. I've managed to wrap it pretty easily...

https://github.com/Owsy/eastwood-junit

In the same way this project wraps test output I suppose...

https://github.com/arohner/lein-test-out

Anyway, if there is interest in a patch I can supply one, otherwise no worries.

@jafingerhut
Copy link
Collaborator

Would adding another value for :warning-format be sufficient, e.g. {:warning-format :junit} ?

@rodnaph
Copy link
Author

rodnaph commented May 7, 2015

I don't think so, based on my limited understanding of Eastwood anyway. Correct me if I'm wrong but it seems that currently the formatted output is written warning by warning eagerly as the codbase is linted, is this correct?

So JUnit for example needs to be an XML document like...

<?xml version="1.0"?>
<testsuites>
  <testsuite package="eastwood.lint">
    <testcase name="eastwood.lint.line3">
      <failure type="linter" message="the failure message" />
    </testcase>
  </testsuite>
</textsuites>

So I can't just write out the warnings as they occur because I also need to include the XML header, group by package/namespace etc... Now, I could probably fudge something if I could get a callback in there but it'd be far far from ideal.

Is my understanding correct or is the output formatting more flexible then I thought? My suggested implementation for formatting structured data would probably need to a hook after all warnings had been created.

@jafingerhut
Copy link
Collaborator

Ah, I see now. Yes, you are correct that the existing code for the :warning-format option makes it straightforward to change the format of individual warnings, one by one, but does not make it easy to change the format of the output as a whole. I will think about this a bit more, later, and add a comment here if I think of anything.

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

No branches or pull requests

2 participants