TE-2851 Preserve stdout on Jenkins test failures

This commit is contained in:
Jeremy Bowman
2019-02-06 14:15:54 -05:00
parent 00cdc7a7ef
commit 3e28f90ed8
3 changed files with 6 additions and 15 deletions

View File

@@ -13,15 +13,12 @@ def runBokchoyTests() {
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', honorRefspec: true, doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', honorRefspec: true,
noTags: true, shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-worker', noTags: true, shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-worker',
refspec: git_refspec, url: "git@github.com:edx/${REPO_NAME}.git"]]] refspec: git_refspec, url: "git@github.com:edx/${REPO_NAME}.git"]]]
console_output = sh(returnStdout: true, script: 'bash scripts/all-tests.sh').trim() sh 'bash scripts/all-tests.sh'
dir('stdout') {
writeFile file: "${TEST_SUITE}-${SHARD}-stdout.log", text: console_output
}
} }
} }
def bokchoyTestCleanup() { def bokchoyTestCleanup() {
archiveArtifacts allowEmptyArchive: true, artifacts: 'test_root/log/**/*.log,test_root/log/**/*.png,stdout/*.log' archiveArtifacts allowEmptyArchive: true, artifacts: 'test_root/log/**/*.log,test_root/log/**/*.png'
junit '**/reports/bok_choy/**/xunit.xml' junit '**/reports/bok_choy/**/xunit.xml'
} }

View File

@@ -12,15 +12,12 @@ def runLettuceTests() {
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', honorRefspec: true, doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', honorRefspec: true,
noTags: true, shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-worker', noTags: true, shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-worker',
refspec: git_refspec, url: "git@github.com:edx/${REPO_NAME}.git"]]] refspec: git_refspec, url: "git@github.com:edx/${REPO_NAME}.git"]]]
console_output = sh(returnStdout: true, script: 'bash scripts/all-tests.sh').trim() sh 'bash scripts/all-tests.sh'
dir('stdout') {
writeFile file: "${TEST_SUITE}-stdout.log", text: console_output
}
} }
} }
def lettuceTestCleanup() { def lettuceTestCleanup() {
archiveArtifacts allowEmptyArchive: true, artifacts: 'test_root/log/**/*.log,stdout/*.log,*.log' archiveArtifacts allowEmptyArchive: true, artifacts: 'test_root/log/**/*.log,*.log'
junit '**/reports/acceptance/*.xml' junit '**/reports/acceptance/*.xml'
} }

View File

@@ -12,16 +12,13 @@ def runPythonTests() {
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', honorRefspec: true, doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', honorRefspec: true,
noTags: true, shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-worker', noTags: true, shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-worker',
refspec: git_refspec, url: "git@github.com:edx/${REPO_NAME}.git"]]] refspec: git_refspec, url: "git@github.com:edx/${REPO_NAME}.git"]]]
console_output = sh(returnStdout: true, script: 'bash scripts/all-tests.sh').trim() sh 'bash scripts/all-tests.sh'
dir('stdout') {
writeFile file: "${TEST_SUITE}-stdout.log", text: console_output
}
stash includes: 'reports/**/*coverage*', name: "${TEST_SUITE}-reports" stash includes: 'reports/**/*coverage*', name: "${TEST_SUITE}-reports"
} }
} }
def pythonTestCleanup() { def pythonTestCleanup() {
archiveArtifacts allowEmptyArchive: true, artifacts: 'reports/**/*,test_root/log/**/*.log,**/nosetests.xml,stdout/*.log,*.log' archiveArtifacts allowEmptyArchive: true, artifacts: 'reports/**/*,test_root/log/**/*.log,**/nosetests.xml,*.log'
junit '**/nosetests.xml' junit '**/nosetests.xml'
sh '''source $HOME/edx-venv/bin/activate sh '''source $HOME/edx-venv/bin/activate
bash scripts/xdist/terminate_xdist_nodes.sh''' bash scripts/xdist/terminate_xdist_nodes.sh'''