Using JetBrains GoLand 2023.1.3, I'm searching the way to customise test covering, because I can't run coverage correctly, yet.
I have a tests
folder which has 31 test files inside.
If, using the IDE, I Run go test from the
tests
folder, the tests execute correctly, but of course, there is no coverage.If I Run go test with coverage from the
tests
folder, and I parameterize the test kind with "Directory", the tests execute correctly, but the coverage strangely covers only tests, and not the code, so that it respond: "100% of the test code is executed". (That's true).If I select all the 31 tests files together and do a Run with coverage, the tests execute correctly, but the coverage cannot be done, I receive "File name too long" error, because GoLand issues a command
/usr/local/go/bin/go tool test2json
wishing to dump into an.out
file whose name is the concatenation of all the file tests names => hundred of characters.
I cannot run manually the command JetBrains GoLand tells me it is running. If I do so, I'm receiving plenty ofbash: QTest<he name of my test>: command not found
errors.If I select few files among my tests files, four or five of them so that the concatenated output file isn't too long, Golang both succeed the tests and the coverage. But performing this way the whole coverage of my code isn't possible.
I'm looking for a way to customise the configuration so that this .out
file name that is too long, I could shorten it. But I see nothing in the run configuration of the coverage.