unify coverage levels for different go versions #2

Open
opened 2022-05-20 10:52:17 +02:00 by wanderer · 0 comments
Owner

there is a rework[1] on the way that changes how go test -cover results are produced.
it can already be observed in CI:

to transcribe what the images show:

  • go test -cover on archlinux/go1.18.2 yields:
    go test -cover ./...
    ... lines ...
    ok  	git.dotya.ml/wanderer/go-xkcdreader	0.038s	coverage: 0.0% of statements
    ok  	git.dotya.ml/wanderer/go-xkcdreader/cmd	0.167s	coverage: 50.0% of statements
    ok  	git.dotya.ml/wanderer/go-xkcdreader/xkcdreader	0.095s	coverage: 20.0% of statements
    
  • go test -cover on fedora36/go1.18 yields:
    go test -cover ./...
    ok  	git.dotya.ml/wanderer/go-xkcdreader	0.014s	coverage: 100.0% of statements
    ok  	git.dotya.ml/wanderer/go-xkcdreader/cmd	0.025s	coverage: 50.0% of statements
    ok  	git.dotya.ml/wanderer/go-xkcdreader/xkcdreader	0.048s	coverage: 20.0% of statements
    

the difference can probably be attributed to the changes already present in go1.18.2.

after applying a patch (also reffed here), the example test coverage appeared to have improved dramatically.

ref [1]: https://github.com/golang/go/issues/51430

there is a rework[1] on the way that changes how `go test -cover` results are produced. it can already be observed in CI: * [archlinux/go1.18.2](https://drone.dotya.ml/wanderer/go-xkcdreader/231/2/5) ![image](/attachments/d3e76a26-22de-4aed-a4ef-c9ff299296c8) * [fedora36/go1.18](https://drone.dotya.ml/wanderer/go-xkcdreader/231/3/5) ![image](/attachments/5c75941c-f2ca-4d29-a594-c8454a0f1c15) to transcribe what the images show: * `go test -cover` on archlinux/go1.18.2 yields: ``` go test -cover ./... ... lines ... ok git.dotya.ml/wanderer/go-xkcdreader 0.038s coverage: 0.0% of statements ok git.dotya.ml/wanderer/go-xkcdreader/cmd 0.167s coverage: 50.0% of statements ok git.dotya.ml/wanderer/go-xkcdreader/xkcdreader 0.095s coverage: 20.0% of statements ``` * `go test -cover` on fedora36/go1.18 yields: ``` go test -cover ./... ok git.dotya.ml/wanderer/go-xkcdreader 0.014s coverage: 100.0% of statements ok git.dotya.ml/wanderer/go-xkcdreader/cmd 0.025s coverage: 50.0% of statements ok git.dotya.ml/wanderer/go-xkcdreader/xkcdreader 0.048s coverage: 20.0% of statements ``` the difference can probably be attributed to the changes already present in go1.18.2. after applying [a patch](https://go-review.googlesource.com/c/go/+/404299/) (also reffed [here](https://github.com/golang/go/issues/51430#issuecomment-1119843774)), the example *test* coverage appeared to have improved dramatically. ref [1]: https://github.com/golang/go/issues/51430
344 KiB
345 KiB
wanderer added the
bug
label 2022-05-20 10:52:17 +02:00
wanderer added the
breakage/upstream
label 2022-05-20 12:10:41 +02:00
wanderer added the
pertains/ci
label 2022-05-25 20:03:58 +02:00
Sign in to join this conversation.
No description provided.