Project: clover
Issue CLOV-1297: HTML report shows only one test result per file if external XML JUnit files are used
In the we can define element which causes that test results are being read from JUnit-compatible XML files, instead of from Clover's coverage recording files. This works as long as the test name can be mapped to the method name (which is usually the case). However, in case of the Spock framework, test cases are named using a free text like: {noformat} def "check if this test does xyz" {noformat} which is later translated to a method named like: {noformat} $spock_feature_0_0 {noformat} As a consequence Clover is not able to match test name to the method name (in order to link to sources). It uses an empty test id to store the test result (SLICE_ID = -1). If there are more than one non-matched method in the same XML file, all get the same ID=-1, thus overwriting each other in hashmap. As a consequence only one is listed. *Fix:* Generate a unique test id using the test name - a String.hashCode() for instance.
Story points: 5