Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-9984

Coverage per tests should be disabled for short living branches

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.7
    • Component/s: Scanner
    • Labels:
      None

      Description

      The coverage per tests feature is not applicable for short living branches. When a test file is changed, it is analyzed, and the coverage per tests will reference other tested files in the project that may not be changed, and so not published in the scanner report. It leads to such errors:

      org.sonar.server.computation.task.projectanalysis.component.VisitException: Visit of Component {key=org.sonarsource.java:java-frontend:src/test/java/org/sonar/java/bytecode/se/BytecodeEGWalkerTest.java:BRANCH:SONARJAVA-2527,uuid=AV8V6qGcIYQXfMu9Zwuj,type=FILE} failed
      	at org.sonar.server.computation.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:41)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitChildren(DepthTraversalTypeAwareCrawler.java:98)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:54)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitChildren(DepthTraversalTypeAwareCrawler.java:98)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:54)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitChildren(DepthTraversalTypeAwareCrawler.java:98)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:54)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
      	at org.sonar.server.computation.task.projectanalysis.step.PersistTestsStep.execute(PersistTestsStep.java:76)
      	at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)
      	at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
      	at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	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.lang.IllegalArgumentException: Component with ref '168' can't be found
      	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
      	at org.sonar.server.computation.task.projectanalysis.component.TreeRootHolderImpl.getComponentByRef(TreeRootHolderImpl.java:58)
      	at org.sonar.server.computation.task.projectanalysis.step.PersistTestsStep$TestDepthTraversalTypeAwareVisitor.getUuid(PersistTestsStep.java:241)
      	at org.sonar.server.computation.task.projectanalysis.step.PersistTestsStep$TestDepthTraversalTypeAwareVisitor.loadCoverageFile(PersistTestsStep.java:225)
      	at org.sonar.server.computation.task.projectanalysis.step.PersistTestsStep$TestDepthTraversalTypeAwareVisitor.loadCoverageDetails(PersistTestsStep.java:216)
      	at org.sonar.server.computation.task.projectanalysis.step.PersistTestsStep$TestDepthTraversalTypeAwareVisitor.persistTestResults(PersistTestsStep.java:119)
      	at org.sonar.server.computation.task.projectanalysis.step.PersistTestsStep$TestDepthTraversalTypeAwareVisitor.visitFile(PersistTestsStep.java:113)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:79)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:51)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
      	... 26 more
      

        Attachments

          Activity

            People

            • Assignee:
              julien.henry Julien Henry
              Reporter:
              julien.henry Julien Henry
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: