How to get rid of space in temp folder of jenkinsRule?

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

How to get rid of space in temp folder of jenkinsRule?

Michael Carter
Doing some research into this it suggested objects with spaces can cause this error.  The only space I could find is in the temp folder name.   Any way to get rid of that space?

Caused: java.io.IOException: While reading class directory: /my-plugin/target/tmp/j h1438579319153760688/jobs/jobname-FreeStyleJacocoOnlyTest/builds/1/jacoco/classes
 at hudson
.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:132)
 at hudson
.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:140)
 at hudson
.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:110)
 at hudson
.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:331)
 at hudson
.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:321)



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of space in temp folder of jenkinsRule?

Gavin Mogan
Why would anything not shell related have problems with spaces in the file paths? Can you just update the code reading it?

I don't know how to remove the space, though honestly I don't think i've ever seen a space in the path but i've never looked carefully sorry.

Gavin

On Tue, Jul 14, 2020 at 1:02 PM Michael Carter <[hidden email]> wrote:
Doing some research into this it suggested objects with spaces can cause this error.  The only space I could find is in the temp folder name.   Any way to get rid of that space?

Caused: java.io.IOException: While reading class directory: /my-plugin/target/tmp/j h1438579319153760688/jobs/jobname-FreeStyleJacocoOnlyTest/builds/1/jacoco/classes
 at hudson
.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:132)
 at hudson
.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:140)
 at hudson
.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:110)
 at hudson
.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:331)
 at hudson
.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:321)



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/CAG%3D_Duv8CMpN%3DPPomS12OqeOmqa%2BB%2BXX8AcZNkpnbvRO%2B3QjmA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of space in temp folder of jenkinsRule?

Michael Carter
Basically I'm running this:

      freeStyleProject = jenkinsRule.createFreeStyleProject("jobname-"+Thread.currentThread().getStackTrace()[1].getMethodName());
     
     
// shell script here to copy file from an already compiled hello world plugin

     
JacocoPublisher jacoco = new JacocoPublisher();
      freeStyleProject
.getPublishersList().add(jacoco);


      freeStyleProject
.getPublishersList().add(new MyTestPublisher("Test"));
     
      freeStyleProject
.save();
      run
= jenkinsRule.assertBuildStatus(Result.SUCCESS, freeStyleProject.scheduleBuild2(0));


The full output:

  48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Collecting JaCoCo coverage data...
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] **/**.exec;**/classes;**/src/main/java; locations are configured
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Number of found exec files for pattern **/**.exec: 1
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Saving matched execfiles:  /my-jenkins-plugin/target/tmp/j h5849944393216790880/workspace/jobname-FreeStyleJacocoOnlyTest/jacoco.exec
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Saving matched class directories for class-pattern: **/classes:
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin]  - /my-jenkins-plugin/target/tmp/j h5849944393216790880/workspace/jobname-FreeStyleJacocoOnlyTest/target/classes 3 files
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java:
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Source Inclusions: **/*.java,**/*.groovy,**/*.kt,**/*.kts
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Source Exclusions:
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] - /my-jenkins-plugin/target/tmp/j h5849944393216790880/workspace/jobname-FreeStyleJacocoOnlyTest/src/main/java 1 files
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] Loading inclusions files..
 
48.772 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] inclusions: []
 
48.773 [jobname-FreeStyleJacocoOnlyTest #1] [JaCoCo plugin] exclusions: []
 
48.823 [jobname-FreeStyleJacocoOnlyTest #1] ERROR: Step ‘Record JaCoCo coverage report’ aborted due to exception:
 
48.823 [id=46] WARNING h.m.AbstractBuild$AbstractBuildExecution#reportError: Step ‘Record JaCoCo coverage report’ aborted due to exception:
java
.lang.IllegalArgumentException
 at org
.objectweb.asm.ClassVisitor.<init>(Unknown Source)
 at org
.jacoco.core.internal.flow.ClassProbesVisitor.<init>(ClassProbesVisitor.java:38)
 at org
.jacoco.core.internal.flow.ClassProbesVisitor.<init>(ClassProbesVisitor.java:28)
 at org
.jacoco.core.internal.analysis.ClassAnalyzer.<init>(ClassAnalyzer.java:59)
 at org
.jacoco.core.analysis.Analyzer$1.<init>(Analyzer.java:97)
 at org
.jacoco.core.analysis.Analyzer.createAnalyzingVisitor(Analyzer.java:94)
 at org
.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:114)
 at org
.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:132)
Caused: java.io.IOException: Error while analyzing /my-jenkins-plugin/target/tmp/j h5849944393216790880/jobs/jobname-FreeStyleJacocoOnlyTest/builds/1/jacoco/classes/io/jenkins/plugins/sample/HelloWorldBuilder$DescriptorImpl.class.
 at org
.jacoco.core.analysis.Analyzer.analyzerError(Analyzer.java:162)
 at org
.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:134)
 at org
.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:157)
 at org
.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:193)
 at org
.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:226)
 at hudson
.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:129)
Caused: java.io.IOException: While reading class directory: /my-jenkins-plugin/target/tmp/j h5849944393216790880/jobs/jobname-FreeStyleJacocoOnlyTest/builds/1/jacoco/classes
 at hudson
.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:132)
 at hudson
.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:140)
 at hudson
.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:110)
 at hudson
.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:331)
 at hudson
.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:321)
 at hudson
.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:675)
 at hudson
.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
 at hudson
.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
 at hudson
.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
 at hudson
.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
 at hudson
.model.Build$BuildExecution.post2(Build.java:186)
 at hudson
.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
 at hudson
.model.Run.execute(Run.java:1905)
 at hudson
.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
 at hudson
.model.ResourceController.execute(ResourceController.java:97)
 at hudson
.model.Executor.run(Executor.java:428)


If I run outside the testing harness everything works fine.


On Tuesday, July 14, 2020 at 4:09:28 PM UTC-4, Gavin Mogan wrote:
Why would anything not shell related have problems with spaces in the file paths? Can you just update the code reading it?

I don't know how to remove the space, though honestly I don't think i've ever seen a space in the path but i've never looked carefully sorry.

Gavin

On Tue, Jul 14, 2020 at 1:02 PM Michael Carter <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="urtN-wsZAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mikeyca...@...> wrote:
Doing some research into this it suggested objects with spaces can cause this error.  The only space I could find is in the temp folder name.   Any way to get rid of that space?

Caused: java.io.IOException: While reading class directory: /my-plugin/target/tmp/j h1438579319153760688/jobs/jobname-FreeStyleJacocoOnlyTest/builds/1/jacoco/classes
 at hudson
.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:132)
 at hudson
.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:140)
 at hudson
.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:110)
 at hudson
.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:331)
 at hudson
.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:321)



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="urtN-wsZAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkin...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/fb58bf12-d996-4a4c-9113-03a517eae8e7o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of space in temp folder of jenkinsRule?

Jesse Glick-4
On Tue, Jul 14, 2020 at 4:24 PM Michael Carter
<[hidden email]> wrote:
> If I run outside the testing harness everything works fine.

Unless, presumably, a hapless user tries to use your plugin with a
path that contains spaces. That is the point of including the space in
the test harness: to remind you to fix this.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/CANfRfr1pSnJ%3DdNgPkb0a%3Dq0thVH2cXxm4%3DAAu29EPrJNBh9r6g%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of space in temp folder of jenkinsRule?

Michael Carter
I found it... I was barking up the wrong tree.    

Added this to my pom.xml and everything started working.   Thanks for the help... sometimes I just need to explain things to someone else to find the problem ;)

        <dependency>
         
<groupId>org.jacoco</groupId>
         
<artifactId>org.jacoco.report</artifactId>
         
<version>0.8.5</version>
         
<scope>test</scope>
       
</dependency>




On Tuesday, July 14, 2020 at 4:45:38 PM UTC-4, Jesse Glick wrote:
On Tue, Jul 14, 2020 at 4:24 PM Michael Carter
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="kBtFMgUbAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mikeyca...@...> wrote:
> If I run outside the testing harness everything works fine.

Unless, presumably, a hapless user tries to use your plugin with a
path that contains spaces. That is the point of including the space in
the test harness: to remind you to fix this.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" 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-dev/9fdbcc0d-8a5b-40da-b816-3beebbdb4a7co%40googlegroups.com.