Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOGITO-7426 Fix pnpm/junit issue #988

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions .ci/jenkins/Jenkinsfile.buildchain
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,14 @@ pipeline {
}
post {
always {
junit(testResults: '**/target/surefire-reports/**/*.xml, **/target/failsafe-reports/**/*.xml, **/target/invoker-reports/**/*.xml', allowEmptyResults: true)
archiveArtifacts(artifacts: '**/cypress/screenshots/**,**/cypress/videos/**', fingerprint: false, allowEmptyArchive: true)
script {
// Remove `node_modules` to avoid heap space issues with junit command thereafter
// Related to https://github.com/jenkinsci/junit-plugin/issues/478 and https://github.com/jenkinsci/junit-plugin/issues/467
sh 'find . -type d -name node_modules -exec rm -rf {} \\; || true'

junit(testResults: '**/junit.xml, **/target/surefire-reports/**/*.xml, **/target/failsafe-reports/**/*.xml, **/target/invoker-reports/**/*.xml', allowEmptyResults: true)
archiveArtifacts(artifacts: '**/cypress/screenshots/**,**/cypress/videos/**', fingerprint: false, allowEmptyArchive: true)
}
}
unsuccessful {
script {
Expand All @@ -150,15 +156,7 @@ pipeline {
}
steps {
script {
def project = (buildChainProject ? util.getProjectGroupName(buildChainProject) : util.getProjectTriggeringJob())[1]

// First guessing whether there is a clone defined into the buildchain config
// If not, fallback to simple folder structure
String projectFolder = "bc/kiegroup_${project}/${project}"
if (!fileExists(projectFolder)) {
projectFolder = "bc/kiegroup_${project}"
}
dir(projectFolder) {
dir(getProjectFolder()) {
maven.runMavenWithSettingsSonar(settingsXmlId, "-e -nsu validate -Psonarcloud-analysis -Denforcer.skip=true ${env.SONARCLOUD_ANALYSIS_MVN_OPTS ?: ''}", 'SONARCLOUD_TOKEN', 'sonar_analysis.maven.log')
}
}
Expand Down Expand Up @@ -245,6 +243,19 @@ boolean shouldNotify() {
return env.ENABLE_NOTIFICATION
}

String getProjectFolder() {
def project = (buildChainProject ? util.getProjectGroupName(buildChainProject) : util.getProjectTriggeringJob())[1]

// First guessing whether there is a clone defined into the buildchain config
// If not, fallback to simple folder structure
String projectFolder = "bc/kiegroup_${project}/${project}"
if (!fileExists(projectFolder)) {
projectFolder = "bc/kiegroup_${project}"
}

return projectFolder
}

String getBuildChainCommandline(boolean includeToken=false) {
return "build-chain build ${buildChainAction} ${includeToken ? "--token ${GITHUB_TOKEN} " : ''}-f 'https://raw.githubusercontent.com/${buildChainConfigGitAuthor}/${buildChainConfigRepo}/${buildChainConfigBranch}/${buildChainConfigDefinitionFilePath}' -o 'bc' ${buildChainAdditionalArguments.join(' ')} --skipParallelCheckout"
}
Expand Down