diff --git a/src/main/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/steps/ProvideLogsStep.groovy b/src/main/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/steps/ProvideLogsStep.groovy index c825ba65..9fd94d93 100644 --- a/src/main/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/steps/ProvideLogsStep.groovy +++ b/src/main/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/steps/ProvideLogsStep.groovy @@ -36,7 +36,7 @@ import org.kohsuke.stapler.DataBoundSetter import java.text.SimpleDateFormat class ProvideLogsStep extends Step { - public static final int DEFAULT_TIMEOUT = 0 + public static final int DEFAULT_TIMEOUT = 36000 private int timeout ProvideLogsStep() { @@ -113,9 +113,13 @@ class ProvideLogsStep extends Step { workspace.child(logDirName).deleteContents() listener.logger.println("Successfully added ecu.test logs to jenkins.") } catch (Exception e) { + if (e instanceof AbortException) { + run.setResult(Result.UNSTABLE) + } else { + run.setResult(Result.FAILURE) + } listener.logger.println('Providing ecu.test logs failed!') listener.error(e.message) - run.setResult(Result.FAILURE) } listener.logger.flush() } diff --git a/src/test/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/ETV1ContainerTest.groovy b/src/test/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/ETV1ContainerTest.groovy index 3bf27abf..a14484a2 100644 --- a/src/test/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/ETV1ContainerTest.groovy +++ b/src/test/groovy/de/tracetronic/jenkins/plugins/ecutestexecution/ETV1ContainerTest.groovy @@ -52,7 +52,7 @@ class ETV1ContainerTest extends ETContainerTest { WorkflowJob job = jenkins.createProject(WorkflowJob.class, "pipeline") job.setDefinition(new CpsFlowDefinition(script, true)) when: "scheduling a new build" - WorkflowRun run = jenkins.buildAndAssertStatus(Result.FAILURE, job) + WorkflowRun run = jenkins.buildAndAssertStatus(Result.UNSTABLE, job) then: "expect successful test completion" jenkins.assertLogContains("Providing ecu.test logs to jenkins.", run)