[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-18 Thread TheDiveO
The only "documentation" is this issue comment https://github.com/golang/go/issues/51430#issuecomment-1344711300 and the reply to my question about the "official status" https://github.com/golang/go/issues/51430#issuecomment-1485320781 On Thursday, August 17, 2023 at 9:51:12 AM UTC+2 Jan wrote:

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-17 Thread Jan
I tried to use the `-test.gocoverdir` (*) and while the test(s) being executed use the given directory, unfortunately it still sets `GOCOVERDIR` to some newly created temporary directory. Since my integration tests are executed from a *_test.go

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-16 Thread Jan
Oh yes, it's true that the new mechanism is more general, and allows integration tests, it's a huge improvement for cases like this! Thanks for the design btw! Now the ergonomics of the case of unit tests + integration tests could be made easier/more ergonomic -- I would assume it is the common

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-16 Thread TheDiveO
Hmm, my previous response got deleted for no reason. So here we go: the new mechanism is more general, and as you can see in my example I actually run the "same" unit tests twice. The reason is because some code paths might be only exercised when not being run as root, especially error handling.

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-16 Thread Jan
Thanks, that's very helpful! I was doing something similar , but I was extracting the temporary coverage directory created by Go because I didn't know about the --test.gocoverdir flag. Still it feels wrong o

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-16 Thread TheDiveO
Maybe similar to this? https://github.com/thediveo/lxkns/blob/cef5a31d7517cb126378f81628f51672cb793527/scripts/cov.sh#L28 On Wednesday, August 16, 2023 at 1:54:48 PM UTC+2 Jan wrote: > hi all, > > After reading the documentation > , I managed to s