Problem with TAP Plugin

6 views
Skip to first unread message

aaron Scholz

unread,
Jan 10, 2019, 1:57:34 PM1/10/19
to Jenkins Users
Hi,

i am running a jenkins master on a ubuntu machine and a slave agent on a Windows 10 PC.
While running that pipeline, I see that "archiveArtifacts" works as expected, but the TapPublisher fails with
an exception.
Is there something wrong in my pipeline script? Or is this a plugin bug?

Any hint for solving this issue?

Maik

My pipeline

        stage('integrationtest') {

            steps {

                dir("$workspace/some_directory") {

                    script {

                        bat "make mytest" // run my tests and write result to tap report

                        archiveArtifacts "*.tap"

                        step([$class: "TapPublisher", testResults: "*.tap" ])

                    }

                }

            }

        }


Console:
...

Archiviere Artefakte

[Pipeline] step

TAP Reports Processing: START

Looking for TAP results report in workspace using pattern: *.tap

Saving reports...

java.io.IOException: Failed to copy C:\prj\jenkins\workspace\MYBUILD\some_directory\mytest.tap to C:/prj/jenkins/workspace/MYBUILD/some_directory/mytest.tap

        at hudson.FilePath.copyTo(FilePath.java:2234)

        at org.tap4j.plugin.TapPublisher.saveReports(TapPublisher.java:567)

        at org.tap4j.plugin.TapPublisher.performImpl(TapPublisher.java:404)

        at org.tap4j.plugin.TapPublisher.perform(TapPublisher.java:371)

        at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)

        at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)

        at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:51)

        at hudson.security.ACL.impersonate(ACL.java:290)

        at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:48)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

        at java.lang.Thread.run(Thread.java:748)

Caused by: java.nio.file.AccessDeniedException: /C:

        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)

        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)

        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)

        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)

        at java.nio.file.Files.createDirectory(Files.java:674)

        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)

        at java.nio.file.Files.createDirectories(Files.java:767)

        at hudson.FilePath.mkdirs(FilePath.java:3273)

        at hudson.FilePath.write(FilePath.java:2094)

        at hudson.FilePath.copyTo(FilePath.java:2230)

        ... 13 more

Failed to save TAP reports

Arnaud bourree

unread,
Jan 11, 2019, 11:57:34 AM1/11/19
to jenkins...@googlegroups.com
Try ant syntax: **/*.tap
Tap files may be located in subfolders 

Arnaud 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/763a964d-990c-4c0f-a693-2f4ca8bff055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

aaron Scholz

unread,
Jan 11, 2019, 12:35:52 PM1/11/19
to Jenkins Users
Hi,
i did some investigation about this issue.
The root cause for this issue is about the different path separator "\" != "/"
used in the saveReports method.
I am able to fix this by added .absolutize() for the source pathes.

Maik

 /** * @param workspace * @param tapDir * @param reports * @param logger * @return */ private boolean saveReports(FilePath workspace, FilePath tapDir, FilePath[] reports, PrintStream logger) { logger.println("Saving reports..."); try { tapDir.mkdirs(); for (FilePath report : reports) { //FilePath dst = tapDir.child(report.getName()); //FilePath dst = getDistDir(workspace, tapDir, report);
FilePath dst = getDistDir(workspace.absolutize(), tapDir, report.absolutize());
 report.copyTo(dst); } } catch (Exception e) { e.printStackTrace(logger); return false; } return true; }

aaron Scholz

unread,
Jan 11, 2019, 12:35:52 PM1/11/19
to Jenkins Users

 /** * @param workspace * @param tapDir * @param reports * @param logger * @return */ private boolean saveReports(FilePath workspace, FilePath tapDir, FilePath[] reports, PrintStream logger) { logger.println("Saving reports..."); try { tapDir.mkdirs(); for (FilePath report : reports) { //FilePath dst = tapDir.child(report.getName()); FilePath dst = getDistDir(workspace, tapDir, report); report.copyTo(dst); } } catch (Exception e) { e.printStackTrace(logger); return false; } return true; }



Am Donnerstag, 10. Januar 2019 19:57:34 UTC+1 schrieb aaron Scholz:
Reply all
Reply to author
Forward
0 new messages