Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Golang Bazel空覆盖率报告.dat_Go_Code Coverage_Bazel - Fatal编程技术网

Golang Bazel空覆盖率报告.dat

Golang Bazel空覆盖率报告.dat,go,code-coverage,bazel,Go,Code Coverage,Bazel,我正在开发一个小型的Golang monorepo,我正在使用Bazel+gazelle管理DEP以及测试、构建、覆盖 我有一个问题,当涉及到覆盖面。我遵循了一些示例,但出于某种原因,coverage_report.dat文件(随后将由genhtml处理)始终为空 这是我使用相对输出运行的命令 $ bazel coverage --combined_report=lcov --cache_test_results=no --test_output=all //... INFO: Using d

我正在开发一个小型的Golang monorepo,我正在使用Bazel+gazelle管理DEP以及测试、构建、覆盖

我有一个问题,当涉及到覆盖面。我遵循了一些示例,但出于某种原因,coverage_report.dat文件(随后将由genhtml处理)始终为空

这是我使用相对输出运行的命令

$ bazel coverage --combined_report=lcov --cache_test_results=no --test_output=all //...

INFO: Using default value for --instrumentation_filter: "^//service/hello[/:],^//service/hellotwo[/:]".
INFO: Override the above default with --instrumentation_filter
INFO: Analyzed 4 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets and 2 test targets...
INFO: From Testing //service/hello:hello_test:
==================== Test output for //service/hello:hello_test:
PASS
coverage: 100.0% of statements
================================================================================
INFO: From Testing //service/hellotwo:hellotwo_test:
==================== Test output for //service/hellotwo:hellotwo_test:
PASS
coverage: 100.0% of statements
================================================================================
INFO: LCOV coverage report is located at /private/var/tmp/_bazel_andrea/292e77b095155ea362773b482c2c4621/execroot/__main__/bazel-out/_coverage/_coverage_report.dat
 and execpath is bazel-out/_coverage/_coverage_report.dat
INFO: Elapsed time: 0.217s, Critical Path: 0.09s
INFO: 3 processes: 1 internal, 2 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
//service/hello:hello_test                                               PASSED in 0.1s
  /private/var/tmp/_bazel_andrea/292e77b095155ea362773b482c2c4621/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/service/hello/hello_test/coverage.dat
//service/hellotwo:hellotwo_test                                         PASSED in 0.1s
  /private/var/tmp/_bazel_andrea/292e77b095155ea362773b482c2c4621/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/service/hellotwo/hellotwo_test/coverage.dat

Executed 2 out of 2 tests: 2 tests pass.
INFO: Build completed successfully, 3 total actions
已计算覆盖率,但
bazel out/\u coverage/\u coverage\u report.dat
为空。我想知道是否有人曾经遇到过这个问题,并设法找到了解决办法

我正在使用MacBook Pro,通过自制程序安装Bazel(v4.1.0)