Test Scheduling API


#1

Hi @bartoszmajsak, @aslak,

This is my idea about the API for the test scheduling feature.

@RunWith(ArquillianScheduling.class)
@Scheduler(LatestFailedScheduler.class)
public class TestClass {

   @Deployment
   public static WebArchive deploy() {
       return Deployments.Client.full();
   }

   @Test
   public void test(){}

}

The ArquillianScheduling.class could be a separate runner that extends Arquillian runner or this functionality could go in the default runner at some point.

public class ArquillianScheduling extends Arquillian {
    private Scheduler scheduler;

    ArquillianScheduling(Class<?> testClass){
            super(testClass);

            // Read the Scheduler annotation
            scheduler = new Scheduler(getChiildren());

            // Apply filtering and sorting
            filter(scheduler.getFilter());
            sort(scheduler.getSorter());
        }

        @Override
        public void run(final RunNotifier notifier){
            super.run(scheduler.getSpyingNotifier(notifier));
        }
}

The first scheduler would be LastFailedScheduler that will put all the failed tests from the previous test run first. By default it will use the local file system to store the necessary statistics information.

I am waiting for your comments.


#2

This feature is useful. Is it considered ?


#3

Sure it is. Dimcho did a great job during summer of code and we will continue evolving it as its own extension very soon. Stay tuned!


#4

I can also help with that if needed.


#5

That would be awesome. I need to work a bit on this to lay out the features, but I will definitely keep you posted. Thanks for your interest!


#6

Count with me about this, I have other scheduling ideas to implement.