Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1297

HTML report shows only one test result per file if external XML JUnit files are used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.1.12
    • 3.1.11
    • Reporting
    • None

    Description

      In the <clover-report> we can define <testresults> 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:

      def "check if this test does xyz"
      

      which is later translated to a method named like:

      $spock_feature_0_0
      

      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.

      Attachments

        Activity

          People

            mparfianowicz Marek Parfianowicz
            mparfianowicz Marek Parfianowicz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: