diff --git a/Dangerfile b/Dangerfile index 07a9aef9a25..40a00aa3e17 100644 --- a/Dangerfile +++ b/Dangerfile @@ -7,20 +7,14 @@ require 'logger' def run_pmdtester Dir.chdir('..') do argv = ['-r', './pmd', '-b', "#{ENV['TRAVIS_BRANCH']}", '-p', 'FETCH_HEAD', '-m', 'online', '-a'] - Process.fork do - begin - runner = PmdTester::Runner.new(argv) - introduce_new_pmd_errors = runner.run - warn("The PR may introduce new PMD errors!") if introduce_new_pmd_errors - rescue StandardError => e - warn("Running pmdtester failed, this message is mainly used to remind the maintainers of PMD.") - @logger.error "Running pmdtester failed: #{e.inspect}" - exit 1 - end - end - Process.wait - - upload_report if $?.success? + begin + runner = PmdTester::Runner.new(argv) + @new_errors, @removed_errors, @new_violations, @removed_violations = runner.run + upload_report + rescue StandardError => e + warn("Running pmdtester failed, this message is mainly used to remind the maintainers of PMD.") + @logger.error "Running pmdtester failed: #{e.inspect}" + end end end @@ -38,7 +32,8 @@ def upload_report @logger.info "Successfully uploaded #{tar_filename} to chunk.io" # set value of sticky to true and the message is kept after new commits are submited to the PR - message("Please check the [regression diff report](#{report_url.chomp}/diff/index.html) to make sure that everything is expected", sticky: true) + message("This changeset introduce #{@new_violations} new violations and #{@new_errors} new errors,\n" + + "removes #{@removed_violations} violations and #{@removed_errors} errors. [Full report](#{report_url.chomp}/diff/index.html)", sticky: true) else @logger.error "Error while uploading #{tar_filename} to chunk.io: #{report_url}" warn("Uploading the diff report failed, this message is mainly used to remind the maintainers of PMD.") diff --git a/Gemfile b/Gemfile index 4894455d47e..2b9ab0d1216 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org/' -gem 'pmdtester', '~> 1.0.0.pre.beta3' +gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git' gem 'danger', '~> 5.6', '>= 5.6' # This group is only needed for rendering release notes