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 <mikeyca...@gmail.com 
> <javascript:>> 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 jenkin...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/f7f89dc7-6113-481f-ab61-b18f9dfb2887o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/fb58bf12-d996-4a4c-9113-03a517eae8e7o%40googlegroups.com.

Reply via email to