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

Report format implementation #81

Merged
merged 1 commit into from
Jun 20, 2017
Merged

Report format implementation #81

merged 1 commit into from
Jun 20, 2017

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Jun 15, 2017

Injests the output from the validators as JSON into PDK::Report and then implements PDK::Report#to_text and PDK::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

cyndane :0: pdk/foo (git:junit!)$ ../bin/pdk validate
pdk (INFO): Running all available validators...
manifests/test.pp:1:8: warning: double quoted string containing no variables
Gemfile:1:1: convention: The name of this source file (`Gemfile`) should use snake_case.
Gemfile:1:29: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:4:26: convention: Use `%r` around regular expression.
Gemfile:5:22: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:5:30: convention: Avoid the use of Perl-style backrefs.
Gemfile:5:34: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:5:45: convention: Avoid the use of Perl-style backrefs.
Gemfile:5:49: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:6:29: convention: Use `%r` around regular expression.
Gemfile:7:16: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:7:42: convention: Avoid the use of Perl-style backrefs.
Gemfile:7:47: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:9:26: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:14:26: convention: Use `%r` around regular expression.
Gemfile:16:9: convention: Use `String#start_with?` instead of a regex match anchored to the beginning of the string.
Gemfile:16:29: convention: Use `%r` around regular expression.
Gemfile:27:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:27:75: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:28:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:29:3: convention: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem `(str "puppet-module-posix-dev-r")` should appear before `(str "puppet-module-win-default-r")`.
Gemfile:29:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:29:75: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:30:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:30:75: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:31:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:31:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:32:3: convention: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem `fast_gettext` should appear before `json_pure`.
Gemfile:32:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:32:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:33:3: convention: Gem `fast_gettext` requirements already given on line 32 of the Gemfile.
Gemfile:33:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:33:56: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:36:82: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:36:101: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:37:82: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:37:101: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:38:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:39:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:39:19: convention: Unnecessary spacing detected.
Gemfile:39:82: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:40:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:41:3: convention: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem `beaker-hostgenerator` should appear before `beaker-rspec`.
Gemfile:41:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:42:3: convention: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem `beaker-abs` should appear before `beaker-hostgenerator`.
Gemfile:42:7: convention: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Gemfile:50:1: convention: Use normalcase for variable numbers.
Gemfile:50:50: convention: Trailing whitespace detected.
Gemfile:51:3: convention: Align the operands of an expression in an assignment spanning multiple lines.
Gemfile:52:3: convention: Align the operands of an expression in an assignment spanning multiple lines.
Gemfile:62:3: convention: Gem `facter` requirements already given on line 60 of the Gemfile.
Gemfile:62:42: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:68:3: convention: Gem `hiera` requirements already given on line 66 of the Gemfile.
Gemfile:68:40: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:74:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:75:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:76:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:77:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:78:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:79:5: convention: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem `minitar` should appear before `win32-service`.
Gemfile:79:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:81:5: convention: Gem `ffi` requirements already given on line 74 of the Gemfile.
Gemfile:81:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:82:5: convention: Gem `win32-eventlog` requirements already given on line 75 of the Gemfile.
Gemfile:82:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:83:5: convention: Gem `win32-process` requirements already given on line 76 of the Gemfile.
Gemfile:83:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:84:5: convention: Gem `win32-security` requirements already given on line 77 of the Gemfile.
Gemfile:84:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:85:5: convention: Gem `win32-service` requirements already given on line 78 of the Gemfile.
Gemfile:85:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:86:5: convention: Gem `minitar` requirements already given on line 79 of the Gemfile.
Gemfile:86:5: convention: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem `minitar` should appear before `win32-service`.
Gemfile:86:51: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:89:42: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:91:6: convention: Use `String#start_with?` instead of a regex match anchored to the beginning of the string.
Gemfile:91:22: convention: Use `%r` around regular expression.
Gemfile:92:34: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:94:34: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:100:39: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:101:39: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:102:39: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:103:39: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:107:3: convention: Gem `win32-dir` requirements already given on line 89 of the Gemfile.
Gemfile:107:37: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:108:3: convention: Gem `win32-eventlog` requirements already given on line 75 of the Gemfile.
Gemfile:108:37: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:109:3: convention: Gem `win32-process` requirements already given on line 76 of the Gemfile.
Gemfile:109:37: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:110:3: convention: Gem `win32-security` requirements already given on line 77 of the Gemfile.
Gemfile:110:37: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:111:3: convention: Gem `win32-service` requirements already given on line 78 of the Gemfile.
Gemfile:111:37: convention: Use the new Ruby 1.9 hash syntax.
Gemfile:112:3: warning: `end` at 112, 2 is not aligned with `if` at 71, 0.
Gemfile:117:34: convention: Avoid comma after the last item of an array.
Gemfile:122:5: convention: The use of `eval` is a serious security risk.
spec/spec_helper.rb:23:3: convention: Use the new Ruby 1.9 hash syntax.
spec/spec_helper.rb:24:3: convention: Use the new Ruby 1.9 hash syntax.
spec/spec_helper.rb:24:35: convention: Avoid comma after the last item of a hash.
spec/spec_helper.rb:31:29: convention: Prefer using `YAML.safe_load` over `YAML.load`.
spec/spec_helper.rb:35:29: convention: Prefer using `YAML.safe_load` over `YAML.load`.
spec/spec_helper.rb:41:1: convention: 1 trailing blank lines detected.
cyndane :0: pdk/foo (git:junit!)$ ../bin/pdk validate --format junit
pdk (INFO): Running all available validators...
<?xml version='1.0'?>
<testsuites>
  <testsuite name='puppet-lint' tests='1' errors='0' failures='1' time='0' timestamp='2017-06-15T13:23:03+10:00'>
    <testcase classname='puppet-lint.double_quoted_strings' name='manifests/test.pp:1:8' time='0'>
      <failure message='warning'>
        manifests/test.pp:1:8: warning: double quoted string containing no
        variables
      </failure>
    </testcase>
  </testsuite>
  <testsuite name='rubocop' tests='101' errors='0' failures='101' time='0' timestamp='2017-06-15T13:23:03+10:00'>
    <testcase classname='rubocop' name='Gemfile:1:1' time='0'>
      <failure message='convention'>
        Gemfile:1:1: convention: The name of this source file (`Gemfile`) should
        use snake_case.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:1:29' time='0'>
      <failure message='convention'>
        Gemfile:1:29: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:4:26' time='0'>
      <failure message='convention'>
        Gemfile:4:26: convention: Use `%r` around regular expression.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:5:22' time='0'>
      <failure message='convention'>
        Gemfile:5:22: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:5:30' time='0'>
      <failure message='convention'>
        Gemfile:5:30: convention: Avoid the use of Perl-style backrefs.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:5:34' time='0'>
      <failure message='convention'>
        Gemfile:5:34: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:5:45' time='0'>
      <failure message='convention'>
        Gemfile:5:45: convention: Avoid the use of Perl-style backrefs.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:5:49' time='0'>
      <failure message='convention'>
        Gemfile:5:49: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:6:29' time='0'>
      <failure message='convention'>
        Gemfile:6:29: convention: Use `%r` around regular expression.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:7:16' time='0'>
      <failure message='convention'>
        Gemfile:7:16: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:7:42' time='0'>
      <failure message='convention'>
        Gemfile:7:42: convention: Avoid the use of Perl-style backrefs.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:7:47' time='0'>
      <failure message='convention'>
        Gemfile:7:47: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:9:26' time='0'>
      <failure message='convention'>
        Gemfile:9:26: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:14:26' time='0'>
      <failure message='convention'>
        Gemfile:14:26: convention: Use `%r` around regular expression.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:16:9' time='0'>
      <failure message='convention'>
        Gemfile:16:9: convention: Use `String#start_with?` instead of a regex
        match anchored to the beginning of the string.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:16:29' time='0'>
      <failure message='convention'>
        Gemfile:16:29: convention: Use `%r` around regular expression.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:27:56' time='0'>
      <failure message='convention'>
        Gemfile:27:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:27:75' time='0'>
      <failure message='convention'>
        Gemfile:27:75: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:28:56' time='0'>
      <failure message='convention'>
        Gemfile:28:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:29:3' time='0'>
      <failure message='convention'>
        Gemfile:29:3: convention: Gems should be sorted in an alphabetical order
        within their section of the Gemfile. Gem `(str
        &quot;puppet-module-posix-dev-r&quot;)` should appear before `(str
        &quot;puppet-module-win-default-r&quot;)`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:29:56' time='0'>
      <failure message='convention'>
        Gemfile:29:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:29:75' time='0'>
      <failure message='convention'>
        Gemfile:29:75: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:30:56' time='0'>
      <failure message='convention'>
        Gemfile:30:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:30:75' time='0'>
      <failure message='convention'>
        Gemfile:30:75: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:31:7' time='0'>
      <failure message='convention'>
        Gemfile:31:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:31:56' time='0'>
      <failure message='convention'>
        Gemfile:31:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:32:3' time='0'>
      <failure message='convention'>
        Gemfile:32:3: convention: Gems should be sorted in an alphabetical order
        within their section of the Gemfile. Gem `fast_gettext` should appear
        before `json_pure`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:32:7' time='0'>
      <failure message='convention'>
        Gemfile:32:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:32:56' time='0'>
      <failure message='convention'>
        Gemfile:32:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:33:3' time='0'>
      <failure message='convention'>
        Gemfile:33:3: convention: Gem `fast_gettext` requirements already given
        on line 32 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:33:7' time='0'>
      <failure message='convention'>
        Gemfile:33:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:33:56' time='0'>
      <failure message='convention'>
        Gemfile:33:56: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:36:82' time='0'>
      <failure message='convention'>
        Gemfile:36:82: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:36:101' time='0'>
      <failure message='convention'>
        Gemfile:36:101: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:37:82' time='0'>
      <failure message='convention'>
        Gemfile:37:82: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:37:101' time='0'>
      <failure message='convention'>
        Gemfile:37:101: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:38:7' time='0'>
      <failure message='convention'>
        Gemfile:38:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:39:7' time='0'>
      <failure message='convention'>
        Gemfile:39:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:39:19' time='0'>
      <failure message='convention'>
        Gemfile:39:19: convention: Unnecessary spacing detected.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:39:82' time='0'>
      <failure message='convention'>
        Gemfile:39:82: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:40:7' time='0'>
      <failure message='convention'>
        Gemfile:40:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:41:3' time='0'>
      <failure message='convention'>
        Gemfile:41:3: convention: Gems should be sorted in an alphabetical order
        within their section of the Gemfile. Gem `beaker-hostgenerator` should
        appear before `beaker-rspec`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:41:7' time='0'>
      <failure message='convention'>
        Gemfile:41:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:42:3' time='0'>
      <failure message='convention'>
        Gemfile:42:3: convention: Gems should be sorted in an alphabetical order
        within their section of the Gemfile. Gem `beaker-abs` should appear
        before `beaker-hostgenerator`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:42:7' time='0'>
      <failure message='convention'>
        Gemfile:42:7: convention: Prefer single-quoted strings when you
        don&apos;t need string interpolation or special symbols.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:50:1' time='0'>
      <failure message='convention'>
        Gemfile:50:1: convention: Use normalcase for variable numbers.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:50:50' time='0'>
      <failure message='convention'>
        Gemfile:50:50: convention: Trailing whitespace detected.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:51:3' time='0'>
      <failure message='convention'>
        Gemfile:51:3: convention: Align the operands of an expression in an
        assignment spanning multiple lines.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:52:3' time='0'>
      <failure message='convention'>
        Gemfile:52:3: convention: Align the operands of an expression in an
        assignment spanning multiple lines.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:62:3' time='0'>
      <failure message='convention'>
        Gemfile:62:3: convention: Gem `facter` requirements already given on
        line 60 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:62:42' time='0'>
      <failure message='convention'>
        Gemfile:62:42: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:68:3' time='0'>
      <failure message='convention'>
        Gemfile:68:3: convention: Gem `hiera` requirements already given on line
        66 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:68:40' time='0'>
      <failure message='convention'>
        Gemfile:68:40: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:74:51' time='0'>
      <failure message='convention'>
        Gemfile:74:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:75:51' time='0'>
      <failure message='convention'>
        Gemfile:75:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:76:51' time='0'>
      <failure message='convention'>
        Gemfile:76:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:77:51' time='0'>
      <failure message='convention'>
        Gemfile:77:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:78:51' time='0'>
      <failure message='convention'>
        Gemfile:78:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:79:5' time='0'>
      <failure message='convention'>
        Gemfile:79:5: convention: Gems should be sorted in an alphabetical order
        within their section of the Gemfile. Gem `minitar` should appear before
        `win32-service`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:79:51' time='0'>
      <failure message='convention'>
        Gemfile:79:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:81:5' time='0'>
      <failure message='convention'>
        Gemfile:81:5: convention: Gem `ffi` requirements already given on line
        74 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:81:51' time='0'>
      <failure message='convention'>
        Gemfile:81:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:82:5' time='0'>
      <failure message='convention'>
        Gemfile:82:5: convention: Gem `win32-eventlog` requirements already
        given on line 75 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:82:51' time='0'>
      <failure message='convention'>
        Gemfile:82:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:83:5' time='0'>
      <failure message='convention'>
        Gemfile:83:5: convention: Gem `win32-process` requirements already given
        on line 76 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:83:51' time='0'>
      <failure message='convention'>
        Gemfile:83:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:84:5' time='0'>
      <failure message='convention'>
        Gemfile:84:5: convention: Gem `win32-security` requirements already
        given on line 77 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:84:51' time='0'>
      <failure message='convention'>
        Gemfile:84:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:85:5' time='0'>
      <failure message='convention'>
        Gemfile:85:5: convention: Gem `win32-service` requirements already given
        on line 78 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:85:51' time='0'>
      <failure message='convention'>
        Gemfile:85:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:86:5' time='0'>
      <failure message='convention'>
        Gemfile:86:5: convention: Gem `minitar` requirements already given on
        line 79 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:86:5' time='0'>
      <failure message='convention'>
        Gemfile:86:5: convention: Gems should be sorted in an alphabetical order
        within their section of the Gemfile. Gem `minitar` should appear before
        `win32-service`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:86:51' time='0'>
      <failure message='convention'>
        Gemfile:86:51: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:89:42' time='0'>
      <failure message='convention'>
        Gemfile:89:42: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:91:6' time='0'>
      <failure message='convention'>
        Gemfile:91:6: convention: Use `String#start_with?` instead of a regex
        match anchored to the beginning of the string.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:91:22' time='0'>
      <failure message='convention'>
        Gemfile:91:22: convention: Use `%r` around regular expression.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:92:34' time='0'>
      <failure message='convention'>
        Gemfile:92:34: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:94:34' time='0'>
      <failure message='convention'>
        Gemfile:94:34: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:100:39' time='0'>
      <failure message='convention'>
        Gemfile:100:39: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:101:39' time='0'>
      <failure message='convention'>
        Gemfile:101:39: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:102:39' time='0'>
      <failure message='convention'>
        Gemfile:102:39: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:103:39' time='0'>
      <failure message='convention'>
        Gemfile:103:39: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:107:3' time='0'>
      <failure message='convention'>
        Gemfile:107:3: convention: Gem `win32-dir` requirements already given on
        line 89 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:107:37' time='0'>
      <failure message='convention'>
        Gemfile:107:37: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:108:3' time='0'>
      <failure message='convention'>
        Gemfile:108:3: convention: Gem `win32-eventlog` requirements already
        given on line 75 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:108:37' time='0'>
      <failure message='convention'>
        Gemfile:108:37: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:109:3' time='0'>
      <failure message='convention'>
        Gemfile:109:3: convention: Gem `win32-process` requirements already
        given on line 76 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:109:37' time='0'>
      <failure message='convention'>
        Gemfile:109:37: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:110:3' time='0'>
      <failure message='convention'>
        Gemfile:110:3: convention: Gem `win32-security` requirements already
        given on line 77 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:110:37' time='0'>
      <failure message='convention'>
        Gemfile:110:37: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:111:3' time='0'>
      <failure message='convention'>
        Gemfile:111:3: convention: Gem `win32-service` requirements already
        given on line 78 of the Gemfile.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:111:37' time='0'>
      <failure message='convention'>
        Gemfile:111:37: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:112:3' time='0'>
      <failure message='warning'>
        Gemfile:112:3: warning: `end` at 112, 2 is not aligned with `if` at 71,
        0.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:117:34' time='0'>
      <failure message='convention'>
        Gemfile:117:34: convention: Avoid comma after the last item of an array.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='Gemfile:122:5' time='0'>
      <failure message='convention'>
        Gemfile:122:5: convention: The use of `eval` is a serious security risk.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='spec/spec_helper.rb:23:3' time='0'>
      <failure message='convention'>
        spec/spec_helper.rb:23:3: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='spec/spec_helper.rb:24:3' time='0'>
      <failure message='convention'>
        spec/spec_helper.rb:24:3: convention: Use the new Ruby 1.9 hash syntax.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='spec/spec_helper.rb:24:35' time='0'>
      <failure message='convention'>
        spec/spec_helper.rb:24:35: convention: Avoid comma after the last item
        of a hash.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='spec/spec_helper.rb:31:29' time='0'>
      <failure message='convention'>
        spec/spec_helper.rb:31:29: convention: Prefer using `YAML.safe_load`
        over `YAML.load`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='spec/spec_helper.rb:35:29' time='0'>
      <failure message='convention'>
        spec/spec_helper.rb:35:29: convention: Prefer using `YAML.safe_load`
        over `YAML.load`.
      </failure>
    </testcase>
    <testcase classname='rubocop' name='spec/spec_helper.rb:41:1' time='0'>
      <failure message='convention'>
        spec/spec_helper.rb:41:1: convention: 1 trailing blank lines detected.
      </failure>
    </testcase>
  </testsuite>
</testsuites>

@rodjek
Copy link
Contributor Author

rodjek commented Jun 15, 2017

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.

@rodjek rodjek force-pushed the junit branch 2 times, most recently from 1658e15 to a6fef63 Compare June 15, 2017 06:29
@DavidS
Copy link
Contributor

DavidS commented Jun 15, 2017

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.

@rodjek rodjek force-pushed the junit branch 13 times, most recently from fb7f30a to 22f4e44 Compare June 19, 2017 10:34
@rodjek rodjek changed the title [WIP] Report format implementation Report format implementation Jun 19, 2017
@rodjek rodjek requested a review from DavidS June 19, 2017 10:36
@rodjek
Copy link
Contributor Author

rodjek commented Jun 19, 2017

This is ready for review now, I think. The acceptance test failures on Windows should get fixed up by the work @scotje is doing in #83

@rodjek rodjek force-pushed the junit branch 4 times, most recently from ee470fd to c191cfe Compare June 20, 2017 12:08
module Backend
class Cmd
def execute_script(script)
if Open3.respond_to?(:capture3)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

@DavidS DavidS merged commit 188cd06 into puppetlabs:master Jun 20, 2017
@rodjek rodjek deleted the junit branch November 26, 2018 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants