-
Notifications
You must be signed in to change notification settings - Fork 105
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
Report format implementation #81
Conversation
One thing to note is when generating junit output from puppet-lint is that we don't get any results for files that don't trigger any lint errors, so if all your manifests passed then you'd end up with a testsuite with 0 tests (which is really not right). It might be better to built a list of files and validate each time seperately so that we can at least create 1 passing testcase for each file. |
1658e15
to
a6fef63
Compare
As discussed this morning: General approach is 👍 - Especially like the report format independent API to collect the log. After we're off the critical path for v1 we'll want to pull this infrastructure out and upstream the formatting. |
fb7f30a
to
22f4e44
Compare
ee470fd
to
c191cfe
Compare
module Backend | ||
class Cmd | ||
def execute_script(script) | ||
if Open3.respond_to?(:capture3) |
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.
huh, in which cases would this be false?
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.
That's a copy of the upstream method, just with the return value munging removed. I'm guessing specinfra supports some old version of ruby where open3 doesn't have a capture3 method? Seems odd, but it works shrug
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.
works for me then.
famous last words.
Injests the output from the validators as JSON into
PDK::Report
and then implementsPDK::Report#to_text
andPDK::Report#to_junit
to handle munging the outputs into the requested formats.In an ideal world we'd use upstream junit formatting, but neither puppet-lint nor metadata-json-lint have junit formatters currently and the rubocop junit plugin seems to be abandoned. Eventually we could get this implemented upstream, but at the moment it'll be quicker to handle it ourselves.
Example output