【发布时间】:2017-07-06 14:48:26
【问题描述】:
我刚刚开始使用 SonarQube,它运行至今。 IT 部门为我们的 Team Foundation Server 设置了 SonarQube 6.2,我已经在我的 BuildAgent 上安装并配置了 msbuild 扫描器。
我在构建定义的 XAML 模板中调用 msbuild 扫描程序,它确实运行,但它给了我一个警告,这使我的构建“部分成功”。 这是错误信息:
07:53:01.658 警告:找不到 Protobuf 文件: d:\b\210\474.sonarqube\out\ReferenceManager_x86_Release_6561\output-cs\issues.pb
issues.pb 文件确实丢失了,但为什么我会收到错误/警告?我不明白这一点,当我从命令行运行扫描仪和 msbuild 时,只有在团队构建中运行时。但是在命令行上运行时也没有issues.pb文件。
从命令行运行扫描仪时,我得到以下输出:
09:34:05.959 INFO: 97 files indexed
09:34:05.985 INFO: Quality profile for cs: Sonar way
09:34:05.992 DEBUG: Code colorizer, supported languages:
09:34:07.008 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
09:34:07.009 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
09:34:07.018 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
09:34:07.023 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
09:34:07.025 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
09:34:07.025 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
09:34:07.027 DEBUG: Sensors : Lines Sensor -> SCM Sensor -> C# -> Coverage Report Import -> Coverage Report Import -> Unit Test Results Import -> XmlFileSensor -> Zero Coverage Sensor -> Code Colorizer Sensor -> CPD Block Indexer
09:34:07.029 INFO: Sensor Lines Sensor
09:34:07.279 INFO: Sensor Lines Sensor (done) | time=250ms
09:34:07.279 INFO: Sensor SCM Sensor
09:34:07.279 INFO: SCM Publisher is disabled
09:34:07.281 INFO: Sensor SCM Sensor (done) | time=2ms
09:34:07.281 INFO: Sensor C#
09:34:07.292 INFO: SonarAnalyzer.Scanner needs to be executed: false
09:34:07.292 INFO: Importing analysis results from C:\Users\Build-SW-Dev\Desktop\.sonarqube\out\ReferenceManager_x86_Release_5730\output-cs
09:34:08.749 INFO: Importing Roslyn report
09:34:08.998 INFO: Sensor C# (done) | time=1717ms
在团队构建期间运行扫描仪时,我得到以下输出:
11:12:51.390 INFO: 97 files indexed
11:12:51.422 INFO: Quality profile for cs: Sonar way
11:12:51.422 DEBUG: Code colorizer, supported languages:
11:12:52.468 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
11:12:52.468 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
11:12:52.468 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:12:52.468 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:12:52.468 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:12:52.468 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
11:12:52.484 DEBUG: Sensors : Lines Sensor -> SCM Sensor -> C# -> Coverage Report Import -> Coverage Report Import -> Unit Test Results Import -> XmlFileSensor -> Zero Coverage Sensor -> Code Colorizer Sensor -> CPD Block Indexer
11:12:52.484 INFO: Sensor Lines Sensor
11:12:52.562 INFO: Sensor Lines Sensor (done) | time=78ms
11:12:52.562 INFO: Sensor SCM Sensor
11:12:52.562 INFO: SCM Publisher is disabled
11:12:52.562 INFO: Sensor SCM Sensor (done) | time=0ms
11:12:52.562 INFO: Sensor C#
11:12:52.562 INFO: SonarAnalyzer.Scanner needs to be executed: false
11:12:52.562 INFO: Importing analysis results from d:\b\210\474\.sonarqube\out\ReferenceManager_x86_Release_1481\output-cs
11:12:53.078 WARN: Protobuf file not found: d:\b\210\474\.sonarqube\out\ReferenceManager_x86_Release_1481\output-cs\issues.pb
11:12:53.718 INFO: Sensor C# (done) | time=1156ms
使用 google 未找到有关此错误的任何信息。任何帮助表示赞赏!
【问题讨论】:
-
您使用的是哪个版本的 TFS?通常,警告不会导致您的构建部分成功,您有特定的设置吗?
-
我们使用的是 TFS 2015 和 xaml 构建模板。我在 XAML 模板的测试部分的构建后部分中调用“MSBuild.SonarQube.Runner.exe end”,如她所述:github.com/SonarSource-VisualStudio/sonar-.net-documentation/… TFS 将此警告转换为错误:在测试运行器 09 之后运行可选脚本:41:38.799 WARN: Protobuf file not found: d:\b\210\474\.sonarqube\out\ReferenceManager_x86_Release_4068\output-cs\issues.pb 当你在 VS 中查看日志时,这里用红色叉号标记。 ..
标签: tfs msbuild sonarqube sonarqube-scan