#58 new
Eric Lefevre-Ardant

Creating an inner-class prompts a complete test detection process

Reported by Eric Lefevre-Ardant | July 28th, 2010 @ 02:07 PM

The slowest thing with Infinitest is the finding of the tests. So it is a little frustrating to sometimes see Infinitest do a detection of the tests from scratch.
The most obvious case is when we create or delete inner-classes, as we frequently do when using Guava's functional-like features (such as Functions).

For example, writing this causes Infinitest to look for all the tests again:

public class MyTest {
    @Test
    public void shouldWork() {
        assertTrue(new Object() {
        } instanceof Object);
    }
}

Deleting the anonymous class causes Infinitest to look for all the tests again:

public class MyTest {
    @Test
    public void shouldWork() {
        assertTrue(true);
    }
}

Performance improvements on that aspect would be nice.

Thanks.

Comments and changes to this ticket

  • Eric Lefevre-Ardant

    Eric Lefevre-Ardant July 28th, 2010 @ 02:15 PM

    I think it does that when renaming a class, too (not surprisingly).

  • benrady (at gmail)

    benrady (at gmail) July 28th, 2010 @ 06:46 PM

    Yes, it's merely annoying when it re-indexes after creating a new top level
    class. I can see how that would be very aggravating when working with a
    library that makes heavy use of inner classes.

  • Jane Prusakova

    Jane Prusakova August 2nd, 2010 @ 05:38 PM

    • Assigned user cleared.

    looking into this

  • benrady (at gmail)

    benrady (at gmail) August 3rd, 2010 @ 01:05 AM

    At least part of the problem here lies in DefaultInfinitestCore.findChangedClassFiles(), which assumes that if any files were removed (or renamed, which the changeDetector treats at the same thing) that the entire index should be reloaded.

    I think simply treating the removed class as changed (thereby running any dependent tests) and removing it from the index would be sufficient, but some exploratory testing after making the change would probably be warranted.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Continuous Test Runner for Java

Shared Ticket Bins

Pages