Problem with TAP Plugin

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with TAP Plugin

aaron Scholz
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

--
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TAP Plugin

aaron Scholz

 /** * @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:
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4089c4b9-9fb5-4f57-b86e-44a469f6310d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TAP Plugin

aaron Scholz
In reply to this post by aaron Scholz
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; }



Am Donnerstag, 10. Januar 2019 19:57:34 UTC+1 schrieb aaron Scholz:
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/18fb2649-e671-4139-afce-0e2f6fb163aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with TAP Plugin

Arnaud bourree
In reply to this post by aaron Scholz
Try ant syntax: **/*.tap
Tap files may be located in subfolders 

Arnaud 

Le jeu. 10 janv. 2019 à 19:57, 'aaron Scholz' via Jenkins Users <[hidden email]> a écrit :
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

--
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 [hidden email].
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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAESUf_As8BAyxDmKyX%3D0UaP96nzRcEd9B3%2BD1TgEi988iU0-bA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.