Skip to content

Commit

Permalink
hotfix to update full path to error logs on CI case fail (#2425)
Browse files Browse the repository at this point in the history
This hotfix PR prepends the full path to the error logs on disk to be
communitated correctly to the GitHub message to the PR that is being
processed when there is a failure in from a case.
  • Loading branch information
TerrenceMcGuinness-NOAA committed Mar 22, 2024
1 parent 50f7552 commit daeb0c8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,19 @@ pipeline {
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_all_batch_jobs ${HOME}/RUNTESTS")
ws(HOME) {
if (fileExists('RUNTESTS/error.logs')) {
def error_logs = sh(script: "cat RUNTESTS/error.logs", returnStdout: true).trim()
try {
pullRequest.comment("Experiment ${Case} failed on ${Machine}\n\nError logs:\n\n${error_logs}")
} catch (Exception error) {
echo "Failed to comment on PR: ${error.getMessage()}"
}
def fileContent = readFile 'RUNTESTS/error.logs'
def lines = fileContent.readLines()
for (line in lines) {
echo "archiving: ${line}"
archiveArtifacts artifacts: "${line}", fingerprint: true
}
sh(script: 'sed -i "s#RUNTESTS#${HOME}/RUNTESTS#g" RUNTESTS/error.logs')
def error_logs = sh(script: "cat RUNTESTS/error.logs", returnStdout: true).trim()
try {
pullRequest.comment("Experiment ${Case} failed on ${Machine}\n\nError logs:\n\n${error_logs}")
} catch (Exception error) {
echo "Failed to comment on PR: ${error.getMessage()}"
}
}
}
error("Failed to run experiments ${Case} on ${Machine}")
Expand Down

0 comments on commit daeb0c8

Please sign in to comment.