I'm in the process of writing a declarative Jenkins pipeline as CI for a project. As part of it, I use GoogleTest and feed the generated xml file to an xunit call.
It might be noteworthy that in another part of this very same pipeline, albeit on a different agent (running on a different OS), this exact same process works smoothly.
On this particular agent, though, being a Linux (Ubuntu) machine, I run the following command (in my Jenkinsfily.groovy):
xunit (
tools: [ GoogleTest(pattern: "gtest_output.xml")],
thresholds: [ failed(failureThreshold: '0') ]
)
and I get the following traceback (substituting <110-characters-long path> with the actual path in question):
java.io.IOException: Cannot create directory '<110-characters-long path>'.
at org.apache.commons.io.FileUtils.mkdirs(FileUtils.java:2200)
at org.apache.commons.io.FileUtils.forceMkdir(FileUtils.java:1383)
at org.jenkinsci.plugins.xunit.service.XUnitTransformerCallable.invoke(XUnitTransformerCallable.java:80)
at org.jenkinsci.plugins.xunit.service.XUnitTransformerCallable.invoke(XUnitTransformerCallable.java:38)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
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 hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
at java.lang.Thread.run(Thread.java:748)
The path it seems to be trying to create follows the pattern of:
<working dir>/generatedJUnitFiles/<some kind of hash>/
Where the hash looks similar to:
1ab234cd-12ab-a12b-b1a2-fe1a2b3c4d5e
(So combinations of letters and numbers delimited with hyphens.)
This exception is very uninformative: I'm not sure why it can't create the directory.
I've been trying a bunch of stuff such as moving (working dir-wise) higher in the hierarchy so as to make the path shorter, but it didn't seem to make a difference. I also tried creating all the directories prior to the hash-named one manually before calling the xunit parser, but that make a difference, either.
I'm not entirely sure how to debug this further and would appreciate any advice about that, or potential causes for this that I should investigate.