gpt4 book ai didi

c# - SonarQube:无法为带有
转载 作者:太空狗 更新时间:2023-10-29 17:55:58 25 4
gpt4 key购买 nike

我们最近将我们的 SonarQube 服务器升级到最新版本 (5.3) 并升级了所有插件。服务器目前仅监视单个构建,即由 Visual Studio Team Services(以前是 Visual Studio Online)构建的 C# 项目。

起初,一切都运行良好(除了我将在另一个问题中描述的长期存在的问题)。但是过了一会儿,当我们尝试将数据推送到 SQ 时,我们开始出现如下所示的错误:

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: Can't create measure for line 47 for file '[PATH]/[FILENAME].cs' with 45 lines
at org.sonar.batch.sensor.coverage.CoverageExclusions.validateMaxLine(CoverageExclusions.java:158)
at org.sonar.batch.sensor.coverage.CoverageExclusions.validate(CoverageExclusions.java:129)
at org.sonar.batch.deprecated.DeprecatedSensorContext.saveMeasure(DeprecatedSensorContext.java:204)
at org.sonar.plugins.dotnet.tests.CoverageReportImportSensor.analyze(CoverageReportImportSensor.java:78)
at org.sonar.plugins.dotnet.tests.CoverageReportImportSensor.analyse(CoverageReportImportSensor.java:59)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more

我们找到了一篇文章 ( https://groups.google.com/forum/#!topic/sonarqube/Xju6ichZe_k),它描述了一种解决方案,涉及更改其中一个插件 (sonar-dotnet-tests-library) 的代码并替换服务器上的构建文件。作为 .NET 的负责人,我们不介意不必修改其他人的 Java 库来使其工作;)

这是问题的解决方案,还是有其他可能导致此问题的原因?目前它阻止我们将数据推送到 SonarQube,这是一种耻辱......

最佳答案

Visual Studio 2015 附带的代码覆盖率工具似乎存在问题。该问题应该已通过 Visual Studio 2015 Update 3 解决。

托管代理也应在发布后立即使用 Update 3 进行更新,TFS 构建团队在这方面做得非常快。有关托管代理上可用软件的列表,请参阅 here .

到那时为止的解决方法:

  1. 不要生成代码覆盖率文件,例如通过禁用 VS 测试构建任务中的选项
  2. 一些用户报告说 VS 2013 不会出现该问题,因此您可能希望使用它构建和/或测​​试而不是使用 VS 2015

关于c# - SonarQube:无法为带有 <X 行的文件的文件的 X 行创建度量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35652047/

25 4 0

Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com