Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Creating an inner-class prompts a complete test detection process

#58

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.

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

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Eric Lefevre-Ardant
    Eric Lefevre-Ardant

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

    July 28th, 2010 @ 02:15 PM

  2. benrady (at gmail)
    benrady (at gmail)

    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.

    July 28th, 2010 @ 06:46 PM

  3. Jane Prusakova
    Jane Prusakova
    • Assigned user cleared.

    looking into this

    August 2nd, 2010 @ 05:38 PM

  4. benrady (at gmail)
    benrady (at gmail)

    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.

    August 3rd, 2010 @ 01:05 AM

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.