The GoTestSensor used for analyzing unit test reports seems to assume that the tests are defined as free functions, whereas depending on the test framework or harness tests can be defined as methods of a test suite.
This is a common pattern using test suites from testify.
The
GoTestSensor
used for analyzing unit test reports seems to assume that the tests are defined as free functions, whereas depending on the test framework or harness tests can be defined as methods of a test suite. This is a common pattern using test suites from testify.The following regex could be updated to optionally support method receivers: https://github.com/SonarSource/sonar-go/blob/master/sonar-go-plugin/src/main/java/org/sonar/go/plugin/GoTestSensor.java#L139