Why ANT?You won't get far using Jenkins and ColdFusion without ANT. ANT is the Hub. It's the glue. Your ANT build will run your MXUnit Tests. Jenkins will run your ANT build, record the results of the tests, and perform post-build actions (notifications, etc) based on the results of those tests. AssumptionsWe assume you have some tests and can successfully run them via either the Eclipse plugin or your web browser We assume that if you are not familiar with ANT that you're willing to learn enough of it to get your CI environment set up. If you're not up for that, perhaps simpler automation is for you. A thorough description of running your tests with ANTBill's original walkthrough is very thorough. In addition, please see Bill's fantastic 8-minute video showing exactly how to run your MXUnit tests with ANT. If you are new to ANT, I implore you to visit those links, especially if you're the type who doesn't like flailing about trying to make sense of foreign things. Even if you simply read Bill's instructions, and watch the video, you'll gain enough familiarity with ANT and MXUnit to move on ot the next step Once you're familiar with running your tests with ANT...Or, if you're the type who likes to jump right in Directory StructureYour final directory structure will look something like the following. If your tests live somewhere else inside your app, that's OK... just make sure to adjust the paths in the build file to account for their location. In the example below, files demoted with an asterisk (*) are files that do not yet exist but which will when we're finished Copy files from MXUnit to your appYou need the following three files to start:
What to put where
Modify build.xmlThe sample build.xml file which you copied is meant to be a good-enough skeleton to get you running your tests from ANT. It also contains example "svn update" and "dist" targets for updating a directory from SVN and creating a zip file, respectively. More on those later. For now, we need to run tests. To do this, you'll modify several of the properties in the ANT file to point to the correct names and locations for your project If you're using Eclipse or another IDE which shows the structure of an ANT file, open the ANT view and drag your build file into it. It'll look something like this: In build.xml:
Run the "init" targetNow, From the ANT view in Eclipse, run the "init" target. In the console view, you'll see a dump of all the properties that will drive your ANT build. Most of these will be file system locations
Here's what the console view will look like when you run init: Run the "runtests" targetAssuming your paths are correct, you have brought the mxunit-ant.jar into your app's "lib" directory, and you have some tests living in your test location, now's the time to run them from ANT.
Next StepsNow that you have ANT running your tests, you're ready to hook this into the Jenkins CI server |
Navigate space |