<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;Before you run any tests it&amp;#8217;s useful to be able to ask Integral which versions of your configured applications are currently installed on either server:&lt;/p&gt;
&lt;pre&gt;
$ thor versions:staging
Application     Version
------------------------------------------------------------------------------
kimble          50825
labrador        50024
catmandu        50548
$ thor versions:live
Application     Version
------------------------------------------------------------------------------
kimble          50825
labrador        50975
catmandu        50548
&lt;/pre&gt;
&lt;p&gt;Note that in the example above that somebody (that&amp;#8217;d be me) hasn&amp;#8217;t deployed the labrador app to the test server before putting it live! This is obviously because I&amp;#8217;ve only just written Integral, and it wasn&amp;#8217;t around a couple of days ago to enforce best practice.&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
$ thor tests:run
&lt;p&gt;It 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:&lt;/p&gt;
&lt;pre&gt;
$ thor tests:recent
Time                                     Outcome
------------------------------------------------------------------------------
Tue Nov 11 17:57:07 +0000 2008           pass
Tue Nov 11 17:58:52 +0000 2008           pass
&lt;/pre&gt;
&lt;p&gt;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:&lt;/p&gt;
$ thor versions:check myapp 123
&lt;p&gt;If version 123 of myapp hasn&amp;#8217;t been tested on the test server &lt;strong&gt;in conjunction with the current live versions of your other applications&lt;/strong&gt; then the command will print an error message and exit with a non-zero return code &#8211; all you need to do is to make sure that your deployment script stops in it&amp;#8217;s tracks if the check fails.&lt;/p&gt;</body>
  <created-at type="datetime">2008-11-11T14:53:28-08:00</created-at>
  <id type="integer">79521</id>
  <permalink>running-your-tests</permalink>
  <repository-id type="integer">72328</repository-id>
  <title>Running Your Tests</title>
  <updated-at type="datetime">2009-03-03T07:12:34-08:00</updated-at>
  <user-id type="integer">2122</user-id>
</wiki>
