[ci] Java rule change is not detected

* Use "HEAD" instead of "FETCH_HEAD" for patch branch.
  FETCH_HEAD might change, if another fetch is done. HEAD
  always points to the currently checked out commit, that
  has been built.
* Add --patch-config to use the same config as for the baseline
  (see .travis/regression-tester.sh). However, currently this
  is ignored, when "--auto-gen-config" is used.
* Use long argument names for better readability

Fixes #2820
This commit is contained in:
Andreas Dangel 2020-10-09 11:03:25 +02:00
parent 462334ccd2
commit d227cffdab
2 changed files with 9 additions and 2 deletions

View File

@ -31,7 +31,7 @@ function regression-tester_uploadBaseline() {
log_info "Generating and uploading baseline for pmdtester..."
cd ..
bundle config --local gemfile pmd/Gemfile
pmd/.travis/travis_wait "bundle exec pmdtester -m single -r ./pmd -p ${TRAVIS_BRANCH} -pc ./pmd/.travis/all-java.xml -l ./pmd/.travis/project-list.xml -f"
pmd/.travis/travis_wait "bundle exec pmdtester --mode single --local-git-repo ./pmd --patch-branch ${TRAVIS_BRANCH} --patch-config ./pmd/.travis/all-java.xml --list-of-project ./pmd/.travis/project-list.xml --html-flag"
cd target/reports
BRANCH_FILENAME="${TRAVIS_BRANCH/\//_}"
zip -q -r ${BRANCH_FILENAME}-baseline.zip ${BRANCH_FILENAME}/

View File

@ -6,7 +6,14 @@ require 'logger'
def run_pmdtester
Dir.chdir('..') do
argv = ['-r', './pmd', '-b', "#{ENV['TRAVIS_BRANCH']}", '-p', 'FETCH_HEAD', '-m', 'online', '-a']
argv = ['--local-git-repo, './pmd',
'--base-branch', "#{ENV['TRAVIS_BRANCH']}",
'--patch-branch', 'HEAD',
'--patch-config', './pmd/.travis/all-java.xml',
'--mode', 'online',
'--auto-gen-config',
# '--debug',
]
begin
runner = PmdTester::Runner.new(argv)
@new_errors, @removed_errors, @new_violations, @removed_violations, @new_configerrors, @removed_configerrors = runner.run