In the Makefile, you generate the coverage report using:
go test -coverprofile $(package)/cover.out $(package)
To generate the test report you need to add:
go test -coverprofile $(package)/cover.out -json $(package) > $(package)/test-report.json
Or if you prefer a single report, you can create an empty file:
echo -n > test-report.json
And append all the tests to it:
go test -coverprofile $(package)/cover.out -json $(package) >> test-report.json
Note: I removed -covermode=count
because it's not useful if the report is only used by SonarGo.