From c84e5eba25f82074ffe35c094e21bf51873ba33c Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 5 Jan 2024 12:38:17 +0100 Subject: [PATCH] Record RuboCop issues for Katello This changes the invocation to directly call RuboCop instead of relying on a rake task. This is copied from smart-proxy.groovy. Interstingly enough, it doesn't use the katello:rubocop:jenkins task that also exists. --- theforeman.org/pipelines/test/foreman/katello.groovy | 7 ++++++- theforeman.org/pipelines/test/testKatello.groovy | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/theforeman.org/pipelines/test/foreman/katello.groovy b/theforeman.org/pipelines/test/foreman/katello.groovy index 60025dc3..d7244ac8 100644 --- a/theforeman.org/pipelines/test/foreman/katello.groovy +++ b/theforeman.org/pipelines/test/foreman/katello.groovy @@ -58,7 +58,12 @@ pipeline { stage('rubocop') { steps { dir('foreman') { - withRVM(['bundle exec rake katello:rubocop TESTOPTS="-v" --trace'], ruby) + withRVM(["bundle exec rubocop --format progress --out ${env.WORKSPACE}/rubocop.log --format progress ${env.WORKSPACE}"], ruby) + } + } + post { + always { + recordIssues tool: ruboCop(pattern: "${env.WORKSPACE}/rubocop.log"), enabledForFailure: true } } } diff --git a/theforeman.org/pipelines/test/testKatello.groovy b/theforeman.org/pipelines/test/testKatello.groovy index 4e27723f..660c66b3 100644 --- a/theforeman.org/pipelines/test/testKatello.groovy +++ b/theforeman.org/pipelines/test/testKatello.groovy @@ -116,7 +116,12 @@ pipeline { stage('rubocop') { steps { dir('foreman') { - withRVM(['bundle exec rake katello:rubocop TESTOPTS="-v" --trace'], ruby) + withRVM(["bundle exec rubocop --format progress --out ${env.WORKSPACE}/rubocop.log --format progress ${env.WORKSPACE}"], ruby) + } + } + post { + always { + recordIssues tool: ruboCop(pattern: "${env.WORKSPACE}/rubocop.log"), enabledForFailure: true } } }