cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.09k stars 290 forks source link

Add codecoverage integration/badge to README.md #638

Open cueckoo opened 3 years ago

cueckoo commented 3 years ago

Originally opened by @andriisoldatenko in https://github.com/cuelang/cue/issues/638

tl;dr it would be great to have codecoverage report generated by codecov, coveralls, gocover

wdyt?

cueckoo commented 3 years ago

Original reply by @verdverm in https://github.com/cuelang/cue/issues/638#issuecomment-759662168

My $0.02 is that a Go specific one would likely be best.

I have tried most general commercial services and find they are quite bad. Codecov provides quite misleading results / badges and should be avoided. Sonarcloud is my fav and has a bunch of extra stuff.

Gocover.io looks nice. I haven't "shopped" around for Go specific.

cueckoo commented 3 years ago

Original reply by @mpvl in https://github.com/cuelang/cue/issues/638#issuecomment-760089565

One issue with code coverage for CUE is that the code is not always tested in the same package as in which it is written. As a result, the basic configuration for code coverage can be misleading: in practice it is considerably higher.

With the recent merger of packages adt and eval this is somewhat mitigated, but still.

Go does allow cross-package code coverage. It just needs to be set up properly and I haven't taken the time to do that. But if someone wants to do it end-to-end, I'll be happy to include it.

cueckoo commented 3 years ago

Original reply by @verdverm in https://github.com/cuelang/cue/issues/638#issuecomment-761197035

Is that where you have to merge test coverage reports or something? Do you have links to where this is doc'd or talked about?

cueckoo commented 3 years ago

Original reply by @mpvl in https://github.com/cuelang/cue/issues/638#issuecomment-762658806

I forgot what the command was or where it is documented, but I recall seeing an option in to go tool for allowing setting up that kind of merging.

cueckoo commented 3 years ago

Original reply by @verdverm in https://github.com/cuelang/cue/issues/638#issuecomment-763000330

It's somewhere in the Go source. I pulled this from it https://github.com/hofstadter-io/hof/blob/_dev/script/runtime/go-cover.go