Every repository with this icon (
Every repository with this icon (
Running Your Tests
Before you run any tests it’s useful to be able to ask Integral which versions of your configured applications are currently installed on either server:
$ thor versions:staging Application Version ------------------------------------------------------------------------------ kimble 50825 labrador 50024 catmandu 50548 $ thor versions:live Application Version ------------------------------------------------------------------------------ kimble 50825 labrador 50975 catmandu 50548
Note that in the example above that somebody (that’d be me) hasn’t deployed the labrador app to the test server before putting it live! This is obviously because I’ve only just written Integral, and it wasn’t around a couple of days ago to enforce best practice.
If we want to stop that from happening again we will need to incorporate the following command into our deployment script, running it immediately after software has been deployed to the test server:
$ thor tests:runIt runs integrate.rb, then checks which versions of your applications are installed on the test server and stores the results of the run in the database. You can see whether or not it was successful by listing the 5 most recent test runs:
$ thor tests:recent Time Outcome ------------------------------------------------------------------------------ Tue Nov 11 17:57:07 +0000 2008 pass Tue Nov 11 17:58:52 +0000 2008 pass
Now you just need to integrate a command like this one into your deployment script, running it just before you deploy the new version of an application to the live server:
$ thor versions:check myapp 123If version 123 of myapp hasn’t been tested on the test server in conjunction with the current live versions of your other applications then the command will print an error message and exit with a non-zero return code – all you need to do is to make sure that your deployment script stops in it’s tracks if the check fails.







