forked from phoedos/pmd
use pmdtester 1.0.0.pre.beta3
This commit is contained in:
10
Dangerfile
10
Dangerfile
@ -1,4 +1,4 @@
|
|||||||
require 'pmdtester/runner'
|
require 'pmdtester'
|
||||||
require 'time'
|
require 'time'
|
||||||
require 'logger'
|
require 'logger'
|
||||||
|
|
||||||
@ -6,14 +6,15 @@ require 'logger'
|
|||||||
|
|
||||||
def run_pmdtester
|
def run_pmdtester
|
||||||
Dir.chdir('..') do
|
Dir.chdir('..') do
|
||||||
argv = ['-r', './pmd', '-b', "#{ENV['TRAVIS_BRANCH']}", '-p', 'FETCH_HEAD', '-m', 'online']
|
argv = ['-r', './pmd', '-b', "#{ENV['TRAVIS_BRANCH']}", '-p', 'FETCH_HEAD', '-m', 'online', '-a']
|
||||||
Process.fork do
|
Process.fork do
|
||||||
begin
|
begin
|
||||||
runner = PmdTester::Runner.new(argv)
|
runner = PmdTester::Runner.new(argv)
|
||||||
runner.run # Optimize: get more information from runner, e.g. introduce new pmd errors?
|
introduce_new_pmd_errors = runner.run
|
||||||
|
warn("The PR may introduce new PMD errors!") if introduce_new_pmd_errors
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
@logger.error "Running pmdtester failed: #{e.msg}"
|
|
||||||
warn("Running pmdtester failed, this message is mainly used to remind the maintainers of PMD.")
|
warn("Running pmdtester failed, this message is mainly used to remind the maintainers of PMD.")
|
||||||
|
@logger.error "Running pmdtester failed: #{e.inspect}"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -37,7 +38,6 @@ def upload_report
|
|||||||
@logger.info "Successfully uploaded #{tar_filename} to chunk.io"
|
@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
|
# 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("Please check the [regression diff report](#{report_url.chomp}/diff/index.html) to make sure that everything is expected", sticky: true)
|
||||||
else
|
else
|
||||||
@logger.error "Error while uploading #{tar_filename} to chunk.io: #{report_url}"
|
@logger.error "Error while uploading #{tar_filename} to chunk.io: #{report_url}"
|
||||||
|
Reference in New Issue
Block a user