diff --git a/.ci/integrationTestDownstream.groovy b/.ci/integrationTestDownstream.groovy index 361a8bdbd..a847b3fb3 100644 --- a/.ci/integrationTestDownstream.groovy +++ b/.ci/integrationTestDownstream.groovy @@ -185,8 +185,11 @@ class IntegrationTestingParallelTaskGenerator extends DefaultParallelTaskGenerat "TMPDIR=${steps.env.WORKSPACE}" ] def label = "${tag}-${x}-${y}" + def dockerLogs = label.replace(":","_").replace(";","_").replace(" ","").replace("--","-") try{ - steps.runScript(label: label, agentType: tag, env: env) + fielbeat(output: "${dockerLogs}.log", archiveOnlyOnFail: true){ + steps.runScript(label: label, agentType: tag, env: env) + } saveResult(x, y, 1) } catch (e){ saveResult(x, y, 0) diff --git a/.ci/integrationTestEC.groovy b/.ci/integrationTestEC.groovy index 07a299fe1..c915918a2 100644 --- a/.ci/integrationTestEC.groovy +++ b/.ci/integrationTestEC.groovy @@ -199,8 +199,10 @@ def runTest(test){ unstash 'source' withConfigEnv(){ catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { - dir("${BASE_DIR}"){ - sh ".ci/scripts/${test}.sh" + fielbeat(output: "${dockerLogs}.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh ".ci/scripts/${test}.sh" + } } } } @@ -262,10 +264,6 @@ def withConfigEnv(Closure body) { def grabResultsAndLogs(label){ withConfigEnv(){ dir("${BASE_DIR}"){ - if(currentBuild.result == 'FAILURE' || currentBuild.result == 'UNSTABLE'){ - dockerLogs(step: label, failNever: true) - sh('.ci/scripts/remove_env.sh docker-info') - } sh('make stop-env || echo 0') archiveArtifacts( allowEmptyArchive: true, diff --git a/.ci/integrationTestECK.groovy b/.ci/integrationTestECK.groovy index d67d47a1f..2aee44a97 100644 --- a/.ci/integrationTestECK.groovy +++ b/.ci/integrationTestECK.groovy @@ -215,8 +215,10 @@ def runTest(test){ unstash 'source' withConfigEnv(){ catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { - dir("${BASE_DIR}"){ - sh ".ci/scripts/${test}.sh" + fielbeat(output: "${dockerLogs}.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh ".ci/scripts/${test}.sh" + } } } } diff --git a/.ci/integrationTestSelector.groovy b/.ci/integrationTestSelector.groovy index 07b0b68c7..34615492b 100644 --- a/.ci/integrationTestSelector.groovy +++ b/.ci/integrationTestSelector.groovy @@ -76,8 +76,10 @@ pipeline { steps { deleteDir() unstash "source" - dir("${BASE_DIR}"){ - sh(label: "Testing ${NAME} ${APP}", script: ".ci/scripts/agent.sh ${NAME} ${APP}") + fielbeat(output: "${NAME}-${APP}-docker.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh(label: "Testing ${NAME} ${APP}", script: ".ci/scripts/agent.sh ${NAME} ${APP}") + } } } post { @@ -97,8 +99,10 @@ pipeline { steps { deleteDir() unstash "source" - dir("${BASE_DIR}"){ - sh(label: "Testing ${NAME} ${OPBEANS_APP}", script: ".ci/scripts/opbeans-app.sh ${NAME} ${APP} ${OPBEANS_APP}") + fielbeat(output: "${OPBEANS_APP}-docker.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh(label: "Testing ${NAME} ${OPBEANS_APP}", script: ".ci/scripts/opbeans-app.sh ${NAME} ${APP} ${OPBEANS_APP}") + } } } post { @@ -122,8 +126,10 @@ pipeline { sh script: ".ci/bump-version.sh ${env.BUILD_OPTS.replaceAll('--rum-agent-branch ', '')} false", label: 'Bump version' sh script: 'make build', label: 'Build docker image with the new rum agent' } - dir("${BASE_DIR}"){ - sh(label: 'Testing RUM', script: '.ci/scripts/opbeans-rum.sh') + fielbeat(output: "opbeans-rum-docker.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh(label: 'Testing RUM', script: '.ci/scripts/opbeans-rum.sh') + } } } post { @@ -147,8 +153,10 @@ pipeline { steps { deleteDir() unstash "source" - dir("${BASE_DIR}"){ - sh ".ci/scripts/all.sh" + fielbeat(output: "all-docker.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh ".ci/scripts/all.sh" + } } } post { @@ -196,8 +204,10 @@ pipeline { steps { deleteDir() unstash "source" - dir("${BASE_DIR}"){ - sh ".ci/scripts/opbeans.sh" + fielbeat(output: "opbeans-docker.log", archiveOnlyOnFail: true){ + dir("${BASE_DIR}"){ + sh ".ci/scripts/opbeans.sh" + } } } post { @@ -218,9 +228,6 @@ pipeline { def wrappingup(Map params = [:]){ def isJunit = params.containsKey('isJunit') ? params.get('isJunit') : true dir("${BASE_DIR}"){ - if(currentBuild.result == 'FAILURE' || currentBuild.result == 'UNSTABLE'){ - dockerLogs(step: "${env.NAME}", failNever: true) - } sh('make stop-env || echo 0') def testResultsPattern = 'tests/results/*-junit*.xml' archiveArtifacts(