-
Bug
-
Resolution: Duplicate
-
Major
When defining a pipeline project and using the following pipeline definition, the jobs gets stuck in "Recording Test Results":
node { stage 'Stage 1' echo 'Hello World 1' stage 'Stage 2' echo 'Hello World 2' bat '''echo. > report.xml''' step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testDataPublishers: [ [$class: 'AttachmentPublisher'] ], testResults: 'report.xml']) }
Removing
[$class: 'AttachmentPublisher']
Makes it work. This is unrelated to the AttachementPublisher plugin - the same happens for any testDataPublishers.
I have debugged it a bit and it seems the root cause if somehow that an AbstractMethodError is thrown from hudson.tasks.junit.TestDataPublisher when it is run from a pipeline (I guess because the pipeline project does not derive from AbstractBuild but from Run).
In any case, returning "null" in TestDataPublisher.contributeTestData() instead of throwing an exception at least prevents getting stuck - it of course does not solve the underlying problem.
Possibly related to JENKINS-28784
- blocks
-
JENKINS-28784 junit-attachments plugin not compatible with Pipeline
- Resolved