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

Test re-ordering not working for *.class patternsets

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.4.3
    • 2.4.2
    • Ant Tasks
    • None

      If .class files are used to match test classes in the junit batchtest element, then test reordering does not take place.

      mstudman: CloverTestSnapshot.calculateDurationOf() needs to be updated to handle .class paths, i believe

      mstudman: so currently it doesn't handle them (estimated duration == 0) but then adds the estimate cost of setup/teardown. the result, both ClassATest and ClassBTest appear to take the same length of time hence the non-optimised ordering

            [CLOV-399] Test re-ordering not working for *.class patternsets

            I took the sample from support CLV-5048 and changed the buildfiles to use java-files instead of class-files (see below).
            Test reordering still doesn't work if I change both source-files, so I assume, that this problem not only relates to *.class patternsets.

            I did the following
            1) run buildfile (all tests are run)
            2) run buildfile (no test is run)
            3) change classA + class B
            4) run buildfile (all tests are run, no reordering takes place)

            ---------------------
            change call to junit from CLV-5048
            ----------------------
            <junit fork="yes" timeout="300000" maxmemory="500m">
            <classpath id="classpath.run.test">
            <pathelement path="classes" />
            <pathelement path="junitclasses" />
            <pathelement path="lib/clover.jar" />
            </classpath>

            <formatter type="brief" usefile="false" />
            <formatter type="xml" />

            <batchtest todir="junitresult" failureproperty="testsFailed">
            <clover-optimized-testset snapshotfile="clover.snapshot" fullrunevery="100">
            <fileset dir="src/junit" includes="**/*Test.java" />
            </clover-optimized-testset>
            </batchtest>
            </junit>
            ---------------------

            Stefan Hansel added a comment - I took the sample from support CLV-5048 and changed the buildfiles to use java-files instead of class-files (see below). Test reordering still doesn't work if I change both source-files, so I assume, that this problem not only relates to *.class patternsets. I did the following 1) run buildfile (all tests are run) 2) run buildfile (no test is run) 3) change classA + class B 4) run buildfile (all tests are run, no reordering takes place) --------------------- change call to junit from CLV-5048 ---------------------- <junit fork="yes" timeout="300000" maxmemory="500m"> <classpath id="classpath.run.test"> <pathelement path="classes" /> <pathelement path="junitclasses" /> <pathelement path="lib/clover.jar" /> </classpath> <formatter type="brief" usefile="false" /> <formatter type="xml" /> <batchtest todir="junitresult" failureproperty="testsFailed"> <clover-optimized-testset snapshotfile="clover.snapshot" fullrunevery="100"> <fileset dir="src/junit" includes="**/*Test.java" /> </clover-optimized-testset> </batchtest> </junit> ---------------------

              mstudman Michael Studman (Inactive)
              npellow Nick
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: