Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--combined_report=lcov not working #3343

Closed
tingilee opened this issue Nov 8, 2022 · 3 comments
Closed

--combined_report=lcov not working #3343

tingilee opened this issue Nov 8, 2022 · 3 comments

Comments

@tingilee
Copy link
Contributor

tingilee commented Nov 8, 2022

What version of rules_go are you using?

v0.35

What version of gazelle are you using?

https://github.com/bazelbuild/bazel-gazelle/archive/6d3fa1c9c7617d52c4a93f280685cde7a8206b07.zip

What version of Bazel are you using?

Build label: 6.0.0-pre.20220922.1

Does this issue reproduce with the latest releases of all the above?

What operating system and processor architecture are you using?

Any other potentially useful information about your toolchain?

What did you do?

bazel coverage --@io_bazel_rules_go//go/config:cover_format=lcov --instrumentation_filter=^// --combined_report=lcov 

What did you expect to see?

See bazel-out/_coverage/_coverage_report.dat being populated

What did you see instead?

bazel-out/_coverage/_coverage_report.dat is empty

@tingilee
Copy link
Contributor Author

tingilee commented Nov 8, 2022

Go coverage is broken when --combined_report=lcov is supplied in external testing:

  1. go_test has a go_library in the embed attribute
  2. go_library needs to provide coverage_common.instrumented_files_info so getInstrumentedFiles in Bazel returns the right instrumented files

I have a proposed fix: tingilee@e68899e
However, I'm encountering failures and could use some help here:

$ bazel test //tests/...
Starting local Bazel server and connecting to it...
ERROR: /Users/jacqueline.lee/rules_go_tingilee/go/tools/coverdata/BUILD.bazel:3:16: in go_tool_library rule //go/tools/coverdata:coverdata: Multiple conflicting returned providers with key InstrumentedFilesInfo
ERROR: /Users/jacqueline.lee/rules_go_tingilee/go/tools/coverdata/BUILD.bazel:3:16: Analysis of target '//go/tools/coverdata:coverdata' failed

tingilee pushed a commit to tingilee/rules_go that referenced this issue Nov 8, 2022
tingilee added a commit to tingilee/rules_go that referenced this issue Nov 8, 2022
@tingilee
Copy link
Contributor Author

tingilee commented Nov 8, 2022

Actually, I've just found #3294 is the fix not yet released.
I've created a PR #3344 to add tests.

@tingilee
Copy link
Contributor Author

Master branch includes the intended solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant