Running the InterMine tests
After getting the source code for InterMine and FlyMine, the first step is to try the tests to confirm that everything runs well in your environment.
Setting up database properties
The PostgreSQL database must be installed and running before the tests can be run. Also database names, a username and a password must be configured in a Java properties file in the home directory of the user who runs the tests.
The file should be named intermine-test.properties
Here is an example:
db.unittest.datasource.serverName=test_host db.unittest.datasource.databaseName=unittest db.unittest.datasource.user=test_user db.unittest.datasource.password=secret db.truncunittest.datasource.serverName=test_host db.truncunittest.datasource.databaseName=truncunittest db.truncunittest.datasource.user=test_user db.truncunittest.datasource.password=secret db.fulldatatest.datasource.serverName=test_host db.fulldatatest.datasource.databaseName=fulldatatest db.fulldatatest.datasource.user=test_user db.fulldatatest.datasource.password=secret db.flatmodeunittest.datasource.serverName=test_host db.flatmodeunittest.datasource.databaseName=flatmodetest db.flatmodeunittest.datasource.user=test_user db.flatmodeunittest.datasource.password=secret db.notxmlunittest.datasource.serverName=test_host db.notxmlunittest.datasource.databaseName=notxmltest db.notxmlunittest.datasource.user=test_user db.notxmlunittest.datasource.password=secret
The following PostgreSQL databases need to be created before the tests can be run: unittest, truncunittest, fulldatatest, flatmodetest, notxmltest, testmodel-webapp-userprofile and testmodel-webapp.
For the webapp tests you will also need a testmodel-webapp.properties file:
db.userprofile-test.datasource.serverName=test_host db.userprofile-test.datasource.databaseName=testmodel-webapp-userprofile db.userprofile-test.datasource.user=test_user db.userprofile-test.datasource.password=secret db.unittest.datasource.serverName=test_host db.unittest.datasource.databaseName=testmodel-webapp db.unittest.datasource.user=test_user db.unittest.datasource.password=secret
Test projects
There are separate test projects for the main InterMine libraries: core objectstore code, the integration code and the webapp code. These are the packages/directories:
- intermine/objectstore/test/
- intermine/integrate/test/
Running the tests
The tests are run by changing to the appropriate directory and running ant with no arguments (see also: a list of useful ant targets). For example:
cd intermine/objectstore/test/ ant
If you get an error like:
java.lang.UnsupportedClassVersionError: org/intermine/task/FileName (Unsupported major.minor version 49.0)
then you are using a version of java that is too old. InterMine needs Java version 5.0 or higher.
The HTML test report will be created in the build directory, eg. intermine/objectstore/test/build/test/results/index.html
We aim to keep the tests at a 100% pass rate at all times.
