stage('integrationtest') {
steps {
dir("$workspace/some_directory") {script {
bat "make mytest" // run my tests and write result to tap report
step([$class: "TapPublisher", testResults: "*.tap" ])
}
}
}
}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 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.
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; }
/** * @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; }