Skip to content

Commit

Permalink
[ci] Java rule change is not detected
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
adangel committed Oct 9, 2020
1 parent 462334c commit d227cff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis/regression-tester.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
Expand Down
9 changes: 8 additions & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d227cff

Please sign in to comment.