You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Kersten <ma...@gmail.com> on 2013/10/14 00:19:56 UTC

Testing Environment

Hi,

   I am just working on a proper test environment.

I am currently starting a WebDriver (selenium) and also starting an
embedded jetty. Since those two adding the main speed penalty to testing, I
just try to reuse them as much as possible.

Now I wonder if someone has a good practice for 'healing' the test
database. I am using a in memory database and the example scenario is a
complete set that is split into various XXXData classes that use
dependencies (requiresData():List<Data>) and are using simple
stratification to find the correct order to load all the data based on the
required data sets of the test to run.

So it is quite easy to erase the database and recreate the database from
scratch. As I speak I notice that I also can provide a modified version of
the Session Factory so I can drop the database and use a new one. But I
guess I can also try to heal each of the rows independently with a fall
back of deleting all rows and recreate the data set.

Is there anything I just need to keep in mind? I reset all services using a
simple interface adding a reset method to it. On reset I just drop all
cached information and reinitialize any service that needs it (most
services are PerThread to simplify Hibernate session handling).

So what do you do? Any ideas, real world experiences? Currently starting
jetty and webdrive adds two or three secs to the test suite since I start
both in parallel. So starting / stopping one or both per test is not a good
idea. How long are your complete test suites (midsize project with around
1k tests?


Cheers,

Martin (Kersten),
Germany