bazel icon indicating copy to clipboard operation
bazel copied to clipboard

docs: --nocache_test_results may actually not always be required for coverage

Open dmivankov opened this issue 3 years ago • 7 comments

Description of the bug:

https://bazel.google.cn/docs/coverage?hl=en#remote-execution

Bazel will currently fail to create coverage information if tests have been cached previously. To work around this, --nocache_test_results can be set specifically for coverage runs, although this of course incurs a heavy cost in terms of test times.

While actually it seems that coverage information can be retrieved from remote cache (at least when test were run locally and only cached remotely?)

$ bazel coverage //:something
//:something                                 (cached) PASSED in 2.2s

  /..../.cache/bazel/..../bazel-out/k8-fastbuild/testlogs/...../coverage.dat

baseline_coverage.dat file is also present

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

NixOS

What is the output of bazel info release?

release 5.1.1- (@non-git)

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

NixOS nixpkgs

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

dmivankov avatar Jun 02 '22 20:06 dmivankov

Hey @dmivankov, could you please provide us with the steps to reproduce the issue? Thanks!

ckolli5 avatar Jun 03 '22 17:06 ckolli5

Hello @dmivankov, If you are looking resolution for the above request. Could you please share the complete steps to reproduce the above issue. Thank you!

sgowroji avatar Jul 04 '22 06:07 sgowroji

We are marking the above Issue as stale because it has not had any recent activity from many days. It will be closed in 7 days if there is no further activity occurs. Thank you.

sgowroji avatar Jul 28 '22 05:07 sgowroji

Closing as it is stale. Please reach us back if you still looking resolution for the above request or open a new issue adding the above as reference.

sgowroji avatar Aug 04 '22 11:08 sgowroji

There are no steps to reproduce documentation issues, sorry

dmivankov avatar Aug 04 '22 11:08 dmivankov

Could you please elaborate your above request. thanks!

sgowroji avatar Aug 04 '22 12:08 sgowroji

Docs say that using --nocache_test_results is needed to get test coverage and that test coverage can't be cached. But actually running bazel coverage without --nocache_test_results can produce coverage output and put coverage output into cache & get it from cache. Maybe this is dependent on rules used or something else, that I'm not entirely sure about.

dmivankov avatar Aug 04 '22 12:08 dmivankov