Testing Plugins on CFWheels 2.x and Travis CI via commandbox

May 31, 2017

Posted in Tutorials

Posted By: Tom King

Tags: 2.0, plugins, travisCI

<p>One of the nicest things about CFWheels 2.x is the tighter integration with command-line tools such as Commandbox. We can take advantage of the new testing suite JSON return type and the new CFWheels CLI in Commandbox 2.x to easily build a Travis CI test. It's perhaps easiest to just show the <code>.travis.yml</code>&nbsp;file - this goes in the root of your gitHub plugin repository, and once you've turned on testing under Travis.org, will run your test suite on every commit. <a href="https://gist.github.com/neokoenig/504ce0108a1caf0f19d54e87c1a8193c" rel="noopener noreferrer" target="_blank">https://gist.github.com/neokoenig/504ce0108a1caf0f19d54e87c1a8193c</a> In sum, this:</p><ol><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>Installs Commandbox</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>Installs the CFWheels CLI</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>Installs the master branch of the CFWheels repository</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>Installs your plugin from your repository (rather than the forgebox version which will be the version behind)</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>Starts the local server</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>Runs the test suite, pointing only at your plugin's unit tests</li></ol><p>Naturally, you could do more complex things with this, such as multiple CF Engines, and maybe even multiple CFWheels versions, but for a quick setup it's a good starting point!</p>

Latest Blog Posts