We run all our tests on every commit using the Continuous Integration service Travis. You can do the same for your fork:
- Log in to Travis-CI with your GitHub account.
- Enable your fork of intermine for Travis builds.
All the tests will be run on every change you make, and you will be notified of errors by email.
After getting the source code for InterMine and ensuring you have all of the required prerequisites, the next step is to try the tests to confirm that everything runs well in your environment.
We also recommend looking at the files that run our continuous integration tests for examples of how this can be automated:
Create blank databases required by the tests named:
notxmltest. See PostgresBasics and introduction to some Postgres commands.
You need to set up a properties file to provide database details to the test code. In your home directory create a file called
intermine-test.properties and update the server name, database names, and database username and password. You can use different database names as long as the actual database name used to create the database and the
db.xxx.datasource.databaseName value match.
The HTML test report will be created in the build directory, eg.
Pull requests are not accepted without passing tests, and we have Travis set up to run tests on every commit. We keep the tests at a 100% pass rate at all times.
InterMine includes a
bio project which contains specific code for biological data and parsers for many data formats. To run tests on this code you need to set up another properties file and create some more databases.
Create blank databases called
bio-fulldata-test(as above you can use different names as long as they match the
db.xxx.datasource.databaseName values. For example:
Set up a properties file to provide database details to the test code. In
.intermine create a file called
intermine-bio-test.properties and configure the server name, database names, and database username and password.
Build database tables automatically generated from the bio model by running the following in
Execute the tests, in
You can also run a test for an individual source by using this syntax:
The test results will be located at
bio/model/test/build/test/results/index.html. You can also run these as JUnit tests directly from Eclipse or Intellij.