blob: fe79d5cdb4b71e4fb65e427260e5ae5b49d6eed3 [file] [log] [blame]
---
site_name: Deltacloud API
title: Writing and running tests
---
<br/>
<h3 id="test">Writing and running tests</h3>
<p>
You should add a test to every new feature or new driver you create to make sure, that everything is running as expected. There are two different directories in the Deltacloud project, where the tests are stored: <strong>/deltacloud/server/tests</strong> for Unit tests for drivers and <strong>/deltacloud/tests</strong> for Cucumber tests.
</p>
<p>Initiate the Unit tests:</p>
<pre>
$ cd /path/to/deltacloud/server
$ rake test
</pre>
<p>This will invoke all Unit tests defined in <strong>/deltacloud/server/tests</strong> by inspecting the Rakefile in <strong>/deltacloud/server</strong>. To invoke a specific driver tests type:</p>
<pre>
$ cd /path/to/deltacloud/server
$ rake test:rackspace
_OR_
$ rake test:mock
_etc_
</pre>
<p>Initiate the Cucumber tests:</p>
<pre>
$ cd /path/to/deltacloud/server
$ rake cucumber
</pre>
<p>Alternatively, you can invoke the cucumber tests directly without using Rakefile: </p>
<pre>
$ cd /path/to/deltacloud/server
$ cucumber ../tests/mock
_OR_
$ cucumber ../tests/ec2
_etc_
</pre>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<i class="icon-arrow-left icon-white"></i> Back
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="/send-patch.html">Send a patch</a></li>
<li><a href="/write"></a></li>
</ul>
</div>