gpt4 book ai didi

未找到 SonarQube Lcov.info

转载 作者:行者123 更新时间:2023-12-04 12:01:32 25 4
gpt4 key购买 nike

我遇到了 SonarQube 实例的问题。我们正在从 istanbul 打印出 lcov 信息,但是 sonarqube 找不到 lcov 信息来生成代码覆盖率。
project.properties 文件在这里,现在删除了 lcov 信息:

sonar.projectKey=*****
sonar.projectName=*****
sonar.projectVersion=1.0
sonar.host.url=***********
sonar.sources=.
sonar.projectBaseDir=./app
sonar.exclusions=**/bower_components/**/*.*,**/vendor/**/*.*
sonar.language=js
sonar.sourceEncoding=UTF-8
sonar.verbose=true
sonar.log.level=DEBUG

但是来自 sonarqube 的日志说它仍在寻找它:
11:19:12.551 INFO: 177/225 files analyzed, current file: /app/app/target/schema/list/target-schema-list-controller_test.js
11:19:15.103 INFO: Unit Test Coverage Sensor is started
11:19:15.103 INFO: 225/225 source files have been analyzed
11:19:15.104 WARN: No coverage information will be saved because LCOV file cannot be found.
11:19:15.104 WARN: Provided LCOV file path: coverage-app/html/lcov.info. Seek file with path: /app/app/coverage-app/html/lcov.info
11:19:15.105 WARN: No coverage information will be saved because all LCOV files cannot be found.
11:19:15.105 INFO: Integration Test Coverage Sensor is started
11:19:15.105 WARN: No coverage information will be saved because LCOV file cannot be found.
11:19:15.106 WARN: Provided LCOV file path: coverage-server/lcov.info. Seek file with path: /app/app/coverage-server/lcov.info
11:19:15.106 WARN: No coverage information will be saved because all LCOV files cannot be found.
11:19:15.106 INFO: Overall Coverage Sensor is started
11:19:15.106 WARN: No coverage information will be saved because LCOV file cannot be found.
11:19:15.106 WARN: Provided LCOV file path: coverage-app/html/lcov.info. Seek file with path: /app/app/coverage-app/html/lcov.info
11:19:15.106 WARN: No coverage information will be saved because LCOV file cannot be found.
11:19:15.107 WARN: Provided LCOV file path: coverage-server/lcov.info. Seek file with path: /app/app/coverage-server/lcov.info
11:19:15.107 WARN: No coverage information will be saved because all LCOV files cannot be found.

如果它没有从我运行 sonarqube 程序的项目属性中获取位置,那么它还能从哪里读取配置?

最佳答案

您应该在 sonar-project.properties 文件中添加此设置:

sonar.javascript.lcov.reportPaths=path/to/coverage/lcov.info

此外,在某些 CI 工具(在我的情况下是 Gitlab CI)中,您可能必须指定 lcov.info 文件是“工件”,因此 Sonar 扫描仪作业不会将其删除

关于未找到 SonarQube Lcov.info,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46074036/

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