Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ pipeline {
sequences.eachWithIndex { sequence, index ->
cachedCommitPragma(clear: true)
println("${index}: ${sequence['description']}")
commit_message = "Test commit\n\n${sequence['pragma']}\n"
String commit_message = "Test commit\n\n${sequence['pragma']}\n"
println(commit_message)
env.tmp_pragmas = pragmasToEnv(commit_message.stripIndent())
withEnv(['STAGE_NAME=Functional Hardware Medium',
Expand All @@ -717,9 +717,9 @@ pipeline {
println(' Result Expect Actual Test')
println(' ------ ------ ------ ----------------------------------------------')
sequences.eachWithIndex { sequence, index ->
result = 'PASS'
expect = 'run '
actual = 'run '
String result = 'PASS'
String expect = 'run '
String actual = 'run '
if (sequence['expect']) { expect = 'skip' }
if (sequence['actual']) { actual = 'skip' }
if (expect != actual) { result = 'FAIL' }
Expand Down
23 changes: 8 additions & 15 deletions vars/buildDaosJob.groovy
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
/* groovylint-disable DuplicateStringLiteral */
// vars/buildDaosJob.groovy

/**
* buildDaosJob step method.
*
* The paramater names must match parameters that are the Jenkinsfile for
* The parameter names must match parameters that are the Jenkinsfile for
* DAOS master.
*
*
* @param config Map of parameters passed
*/

void call(String branch, String priority) {
setupDownstreamTesting('daos-stack/daos', branch,
List buildOptions = setupDownstreamTesting('daos-stack/daos', branch,
(cachedCommitPragma('Test-skip-build', 'false') == 'true' ?
'Skip-build: true' : '') +
(cachedCommitPragma('Skip-downstream-test', 'false') == 'true' ?
'\nSkip-test: true' : ''))

build job: 'daos-stack/daos/' + setupDownstreamTesting.test_branch((branch)),
parameters: [string(name: 'TestTag',
List buildParameters = [string(name: 'TestTag',
value: cachedCommitPragma(
'Test-tag',
'load_mpi test_core_files ' +
'test_pool_info_query')),
string(name: 'CI_RPM_TEST_VERSION',
value: cachedCommitPragma('Test-skip-build', 'false') == 'true' ?
daosLatestVersion(branch) : ''),
string(name: 'BuildPriority', value: priority),
booleanParam(name: 'CI_FI_el8_TEST', value: true),
booleanParam(name: 'CI_MORE_FUNCTIONAL_PR_TESTS', value: true),
booleanParam(name: 'CI_FUNCTIONAL_el9_TEST', value: true),
booleanParam(name: 'CI_FUNCTIONAL_el8_TEST', value: true),
booleanParam(name: 'CI_FUNCTIONAL_leap15_TEST', value: true),
booleanParam(name: 'CI_medium_TEST', value: false),
booleanParam(name: 'CI_large_TEST', value: false)
]
string(name: 'BuildPriority', value: priority)] + buildOptions
build job: 'daos-stack/daos/' + setupDownstreamTesting.test_branch((branch)),
parameters: buildParameters
}
56 changes: 43 additions & 13 deletions vars/setupDownstreamTesting.groovy
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
/* groovylint-disable DuplicateStringLiteral, GStringExpressionWithinString */
// vars/setupDownstreamTesting.groovy

String test_branch(String target) {
return 'ci-' + JOB_NAME.replaceAll('/', '-') +
'-' + target.replaceAll('/', '-')
}

List githubAccess() {
return [[$class: 'UsernamePasswordMultiBinding',
credentialsId: 'daos_jenkins_project_github_access',
usernameVariable: 'GH_USER',
passwordVariable: 'GH_PASS']]
}

void cleanup(String project, String branch) {
withCredentials([[$class: 'UsernamePasswordMultiBinding',
credentialsId: 'daos_jenkins_project_github_access',
usernameVariable: 'GH_USER',
passwordVariable: 'GH_PASS']]) {
withCredentials(githubAccess()) {
sh(label: 'Delete test branch',
script: 'if ! git push https://$GH_USER:[email protected]/' + project +
' --delete ' + test_branch(branch) + '''; then
Expand All @@ -25,18 +30,26 @@ void cleanup(String project, String branch) {
/**
* setupDownstreamTesting.groovy
*
* Set up a branch to perform dowstream testing on
* Set up a branch to perform downstream testing on
*/

/* groovylint-disable-next-line NoDef, ParameterName */
void call(String project, String branch, String commit_pragmas = '') {
/* groovylint-disable-next-line MethodSize, NoDef, ParameterName */
List call(String project, String branch, String commit_pragmas = '') {
// TODO: find out what the / escape is. I've already tried both %2F and %252F
// https://issues.jenkins.io/browse/JENKINS-68857
// Instead, we will create a branch specifically to test on
withCredentials([[$class: 'UsernamePasswordMultiBinding',
credentialsId: 'daos_jenkins_project_github_access',
usernameVariable: 'GH_USER',
passwordVariable: 'GH_PASS']]) {
List knownParameters = ['CI_FI_el8_TEST',
'CI_MORE_FUNCTIONAL_PR_TESTS',
'CI_FUNCTIONAL_el9_TEST',
'CI_FUNCTIONAL_el8_TEST',
'CI_FUNCTIONAL_leap15_TEST',
'CI_medium_TEST',
'CI_large_TEST'
]

List result = []
String checkoutDir = project.split('/')[1] + '-' + branch.replaceAll('/', '-')
withCredentials(githubAccess()) {
sh label: 'Create or update test branch',
/* groovylint-disable-next-line GStringExpressionWithinString */
script: 'branch_name=' + test_branch(branch) + '''
Expand All @@ -47,7 +60,7 @@ void call(String project, String branch, String commit_pragmas = '') {
branch) + '''
# dir for checkout since all runs in the matrix share the same
# workspace
dir="''' + project.split('/')[1] + '-' + branch.replaceAll('/', '-') + '''"
dir="''' + checkoutDir + '''"
#rm -rf "$dir"
if cd $dir; then
git remote update
Expand Down Expand Up @@ -100,8 +113,24 @@ void call(String project, String branch, String commit_pragmas = '') {
git push -f origin $branch_name:$branch_name
sleep 10'''
} // withCredentials

// Set up parameters for downstream testing
// Check which known parameters exist in the Jenkinsfile
String jenkinsfilePath = checkoutDir + '/Jenkinsfile'
if (fileExists(jenkinsfilePath)) {
String jenkinsfileContent = readFile(jenkinsfilePath)
knownParameters.each { param ->
if (jenkinsfileContent.contains(param)) {
Boolean defaultValue = param in ['CI_medium_TEST', 'CI_large_TEST'] ? false : true
result.add(booleanParam(name: param, value: defaultValue))
}
}
} else {
echo "Warning: Jenkinsfile not found at ${jenkinsfilePath}"
}

sh label: 'Delete local test branch',
script: '''dir="''' + project.split('/')[1] + '-' + branch.replaceAll('/', '-') + '''"
script: '''dir="''' + checkoutDir + '''"
if ! cd $dir; then
echo "$dir does not exist"
exit 1
Expand All @@ -112,4 +141,5 @@ void call(String project, String branch, String commit_pragmas = '') {
git branch -a
exit 1
fi'''
return result
} // call
35 changes: 16 additions & 19 deletions vars/valgrindReportPublish.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
*/

void call(Map config = [:]) {
if (env.DAOS_VALGRIND_DISABLED != null) {
//if (env.DAOS_VALGRIND_DISABLED != null) {
// Valgrind plugin is not being maintained and is generating log noise
// This is to allow testing with it disabled or missing.
println 'Valgrind publishing disabled via DAOS_VALGRIND_DISABLED'
return
}
// println 'Valgrind publishing disabled via DAOS_VALGRIND_DISABLED'
// return
//}
Comment on lines +20 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this commented out section need to be removed before landing?

List stashes = []
if (config['valgrind_stashes']) {
stashes = config['valgrind_stashes']
Expand Down Expand Up @@ -61,22 +61,19 @@ void call(Map config = [:]) {
return
}

/* groovylint-disable-next-line NoDef, VariableTypeRequired */
def cb_result = currentBuild.result
publishValgrind failBuildOnInvalidReports: true,
failBuildOnMissingReports: !ignore_failure,
failThresholdDefinitelyLost: '0',
failThresholdInvalidReadWrite: '0',
failThresholdTotal: '0',
pattern: valgrind_pattern,
publishResultsForAbortedBuilds: false,
publishResultsForFailedBuilds: true,
sourceSubstitutionPaths: '',
unstableThresholdDefinitelyLost: '0',
unstableThresholdInvalidReadWrite: '0',
unstableThresholdTotal: '0'
String cb_result = currentBuild.result
recordIssues enabledForFailure: true,
failOnError: !ignore_failure,
ignoreQualityGate: false,
qualityGates: [
[threshold: 1, type: 'TOTAL_ERROR'],
[threshold: 1, type: 'TOTAL_HIGH']],
name: 'Valgrind Memory Check',
tool: valgrind(pattern: valgrind_pattern,
name: 'Valgrind Results',
id: 'valgrind')

if (cb_result != currentBuild.result) {
println "The publishValgrind step changed result to ${currentBuild.result}."
println "The recordIssues step changed result to ${currentBuild.result}."
}
}