Reputation: 580
I have a very special requirement in integration testing in go. In the past few days I have read through many blogs but I am unable to get the solution for this problem. Please share me if you have done anything below.
Infra details:
My Exact requirement is:
Thanks in advance!!
Upvotes: 2
Views: 4841
Reputation: 251
The goc tool should meet your needs, it basically just need three steps:
goc server
commandgoc build .
to build your Go code and execute the generated binary which would register itself into the registry center abovegoc profile
to get the code coverage profile at anytimeUpvotes: 1
Reputation: 34427
write your Go code as a test, in a file ending_test in the package directory
run the Go test as $ go test --coverprofile outfile
. If it needs to run as a server then add some code to time it out
run your additional Java code
wait for the timeout
use a command like $ go tool cover -html=outfile -o cover.html
to see the coverage analysis
Upvotes: 6