Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17586

Clover Results Collector looking for clover.xml in wrong location (Ant)

XMLWordPrintable

      Summary

      With automatic integration, Clover Results Collector tries to find clover.xml in the wrong subdirectory in a job that involves an Ant task when another non-VCS checkout task (e.g. Script) is present above it in the task order.

      The search pattern applied is:
      /target/site/clover/**/clover.xml (which is applicable for Maven tasks)

      Instead of:
      /clover/**/clover.xml (for Ant)

      Impact: Clover tab is not visible for a Job. Clover statistics are not available in build Metadata after the build.

      Steps to Reproduce

      1. Create a basic plan and job
      2. Setup the following task order:
        1. Script
        2. Source code checkout
        3. Ant build
      3. Go to the miscellaneous tab of the job and:
        1. Check 'Use Clover to collect Code Coverage for this build.'
        2. Enable 'Automatically integrate Clover into this build.'
      4. Save (Regardless of if you've changed the clover integration setting. This should trigger the clover XML location to update incorrectly based on the first task)
      5. Trigger a build

      Expected Results

      Clover Results Collector tries to find clover.xml in the correct pattern for Ant: /clover/**/clover.xml

      Actual Results

      The below exception is reported in atlassian-bamboo.log

      [ExecuteBuildTask] Failed to execute plugin with class com.atlassian.bamboo.clover.builder.coverage.CloverBuildProcessor : ANT-JOB1-1
      java.lang.Exception: No file matches the specified pattern:target/site/clover/**/clover.xml in [/var/bamboo-home/xml-data/build-dir/ANT-JOB1]
      	at com.atlassian.bamboo.clover.builder.coverage.CloverBuildProcessor.call(CloverBuildProcessor.java:156)
      	at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.performCustomBuildProcess(ExecuteBuildTask.java:158)
      	at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:79)
      	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215)
      	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139)
      	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221)
      	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129)
      	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      	at java.lang.Thread.run(Thread.java:745)
      

      Following is present in the build log:

      Failed to execute plugin 'Clover Results Collector' with error: No file matches the specified pattern:target/site/clover/**/clover.xml in [/var/bamboo-home/xml-data/build-dir/ANT-JOB1]
      

      Workaround

      1. Configure the plan and job.
      2. Move the Ant task to the top of the job so it's the first task
      3. Go to the miscellaneous tab of the job:
        1. Ensure 'Automatically integrate Clover into this build.' is checked.
        2. Save - regardless of whether changes are made to automatically integrate clover. This should trigger a path update with Ant as the first task.
      4. Go back to the Task tab and return the Ant task to it's appropriate position in the job. (Don't save the miscellaneous tab again after you've moved Ant back down the task order)

              Unassigned Unassigned
              jowen@atlassian.com Jeremy Owen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: