|
34 | 34 | # </file>
|
35 | 35 | #
|
36 | 36 | cs_report = 'target/checkstyle-result.xml'
|
37 |
| -unless File.file?(cs_report) |
38 |
| - warn("Couldn't find #{cs_report}. maven-checkstyle-plugin result is unknown") |
39 |
| -else |
| 37 | +if File.file?(cs_report) |
40 | 38 | errors_count = 0
|
41 | 39 | doc = Nokogiri::XML(File.open(cs_report))
|
42 | 40 | doc.xpath('//error').each do |node|
|
|
60 | 58 | # </file>
|
61 | 59 | #
|
62 | 60 | pmd_report = 'target/pmd.xml'
|
63 |
| -unless File.file?(pmd_report) |
64 |
| - warn("Couldn't find #{pmd_report}. maven-pmd-plugin result is unknown") |
65 |
| -else |
| 61 | +if File.file?(pmd_report) |
66 | 62 | errors_count = 0
|
67 | 63 | doc = Nokogiri::XML(File.open(pmd_report))
|
68 | 64 | doc.xpath('//violation').each do |node|
|
|
99 | 95 | # </CodeNarc>
|
100 | 96 | #
|
101 | 97 | codenarc_report = 'target/CodeNarc.xml'
|
102 |
| -unless File.file?(codenarc_report) |
103 |
| - warn("Couldn't find #{codenarc_report}. codenarc-maven-plugin result is unknown") |
104 |
| -else |
| 98 | +if File.file?(codenarc_report) |
105 | 99 | errors_count = 0
|
106 | 100 | doc = Nokogiri::XML(File.open(codenarc_report))
|
107 | 101 | root_dir = doc.xpath('//SourceDirectory').first.text.sub(pwd, '')
|
|
128 | 122 | # [INFO] ------------------------------------------------------------------------
|
129 | 123 | #
|
130 | 124 | license_output = 'license.log'
|
131 |
| -unless File.file?(license_output) |
132 |
| - warn("Couldn't find #{license_output}. license-maven-plugin result is unknown") |
133 |
| -else |
| 125 | +if File.file?(license_output) |
134 | 126 | errors = []
|
135 | 127 | File.readlines(license_output)
|
136 | 128 | .select { |line| line.start_with? '[WARNING]' }
|
|
177 | 169 | # [INFO] ------------------------------------------------------------------------
|
178 | 170 | #
|
179 | 171 | sortpom_output = 'pom.log'
|
180 |
| -unless File.file?(sortpom_output) |
181 |
| - warn("Couldn't find #{sortpom_output}. sortpom-maven-plugin result is unknown") |
182 |
| -else |
| 172 | +if File.file?(sortpom_output) |
183 | 173 | errors = []
|
184 | 174 | File.readlines(sortpom_output).each do |line|
|
185 | 175 | # don't process lines after this message
|
|
225 | 215 | # 3 lint error(s) found across 20 file(s).
|
226 | 216 | #
|
227 | 217 | bootlint_output = 'bootlint.log'
|
228 |
| -unless File.file?(bootlint_output) |
229 |
| - warn("Couldn't find #{bootlint_output}. Result of bootlint is unknown") |
230 |
| -else |
| 218 | +if File.file?(bootlint_output) |
231 | 219 | errors_count = 0
|
232 | 220 | File.readlines(bootlint_output).each do |line|
|
233 | 221 | if line !~ /:\d+:\d+/
|
|
255 | 243 | # E: 35, 0: Too many steps (34) in test case (TooManyTestSteps)
|
256 | 244 | #
|
257 | 245 | rflint_output = 'rflint.log'
|
258 |
| -unless File.file?(rflint_output) |
259 |
| - warn("Couldn't find #{rflint_output}. Result of rflint is unknown") |
260 |
| -else |
| 246 | +if File.file?(rflint_output) |
261 | 247 | errors_count = 0
|
262 | 248 | current_file = ''
|
263 | 249 | File.readlines(rflint_output).each do |line|
|
|
289 | 275 | # [INFO] ------------------------------------------------------------------------
|
290 | 276 | #
|
291 | 277 | enforcer_output = 'enforcer.log'
|
292 |
| -unless File.file?(enforcer_output) |
293 |
| - warn("Couldn't find #{enforcer_output}. maven-enforcer-plugin result is unknown") |
294 |
| -else |
| 278 | +if File.file?(enforcer_output) |
295 | 279 | errors = []
|
296 | 280 | plugin_output_started = false
|
297 | 281 | File.readlines(enforcer_output).each do |line|
|
|
339 | 323 | # </testsuite>
|
340 | 324 | #
|
341 | 325 | jasmine_report = 'target/jasmine/TEST-jasmine.xml'
|
342 |
| -unless File.file?(jasmine_report) |
343 |
| - warn("Couldn't find #{jasmine_report}. jasmine-maven-plugin results is unknown") |
344 |
| -else |
| 326 | +if File.file?(jasmine_report) |
345 | 327 | doc = Nokogiri::XML(File.open(jasmine_report))
|
346 | 328 | testsuite = doc.xpath('/testsuite').first
|
347 | 329 | failures = testsuite['failures'].to_i
|
|
364 | 346 | # "file:/home/coder/mystamps/src/main/webapp/WEB-INF/views/series/info.html":438.16-438.35: error: very long err msg.
|
365 | 347 | #
|
366 | 348 | validator_output = 'validator.log'
|
367 |
| -unless File.file?(validator_output) |
368 |
| - warn("Couldn't find #{validator_output}. html5validator result is unknown") |
369 |
| -else |
| 349 | +if File.file?(validator_output) |
370 | 350 | errors_count = 0
|
371 | 351 | File.readlines(validator_output).each do |line|
|
372 | 352 | errors_count += 1
|
|
431 | 411 | # Also because goals are executing in order and the process stops if one of
|
432 | 412 | # them failed, we're using the same array to collect errors from different goals.
|
433 | 413 | test_output = 'test.log'
|
434 |
| -unless File.file?(test_output) |
435 |
| - warn("Couldn't find #{test_output}. Result of running unit tests is unknown") |
436 |
| -else |
| 414 | +if File.file?(test_output) |
437 | 415 | errors = []
|
438 | 416 | plugin_output_started = false
|
439 | 417 | errors_detected = false
|
|
521 | 499 | #
|
522 | 500 | test_reports_pattern = 'target/surefire-reports/TEST-*.xml'
|
523 | 501 | test_reports = Dir.glob(test_reports_pattern)
|
524 |
| -if test_reports.empty? |
525 |
| - warn("Couldn't find #{test_reports_pattern}. maven-surefire-plugin results is unknown") |
526 |
| -else |
| 502 | +unless test_reports.empty? |
527 | 503 | errors_count = 0
|
528 | 504 | test_reports.each do |file|
|
529 | 505 | doc = Nokogiri::XML(File.open(file))
|
|
568 | 544 | # </BugCollection>
|
569 | 545 | #
|
570 | 546 | findbugs_report = 'target/findbugsXml.xml'
|
571 |
| -unless File.file?(findbugs_report) |
572 |
| - warn("Couldn't find #{findbugs_report}. findbugs-maven-plugin result is unknown") |
573 |
| -else |
| 547 | +if File.file?(findbugs_report) |
574 | 548 | errors_count = 0
|
575 | 549 | doc = Nokogiri::XML(File.open(findbugs_report))
|
576 | 550 | src_dirs = doc.xpath('//SrcDir').map { |node| node.text }
|
|
604 | 578 | # </test>
|
605 | 579 | # </suite>
|
606 | 580 | rf_report = 'target/robotframework-reports/output.xml'
|
607 |
| -unless File.file?(rf_report) |
608 |
| - warn("Couldn't find #{rf_report}. robotframework-maven-plugin result is unknown") |
609 |
| -else |
| 581 | +if File.file?(rf_report) |
610 | 582 | errors_count = 0
|
611 | 583 | doc = Nokogiri::XML(File.open(rf_report))
|
612 | 584 | doc.xpath('//status[@critical="yes"][@status="FAIL"]').each do |node|
|
|
646 | 618 | # ...
|
647 | 619 | #
|
648 | 620 | failsafe_report = 'target/failsafe-reports/testng-results.xml'
|
649 |
| -unless File.file?(failsafe_report) |
650 |
| - warn("Couldn't find #{failsafe_report}. maven-failsafe-plugin result is unknown") |
651 |
| -else |
| 621 | +if File.file?(failsafe_report) |
652 | 622 | errors_count = 0
|
653 | 623 | doc = Nokogiri::XML(File.open(failsafe_report))
|
654 | 624 | results = doc.xpath('/testng-results').first
|
|
0 commit comments