|
From: Tim R. <tim...@gm...> - 2008-02-26 20:39:42
|
I'm using mxmlc to compile my asunit test runner with an ant build script. I'm wondering if there's an easy way to hook this in so that if my unit tests fail, the build process will stop (does it asunit / flexunit support this?). Basically I'm looking for more robust output than just visually identifying that a test has failed from the resulting testrunner swf. Has someone done this before or can provide some insight to point me in the right direction? Other gems about how your continuous integration process works with asunit would be swell too. |
|
From: Luke B. <lb...@pa...> - 2008-02-26 21:47:23
|
Hey Tim, YES! The quickest and easiest way to get it done, is to drop Ant altogether and move to Project Sprouts (http://www.projectsprouts.org). You can still trigger a rake build from cruise control using the cruise 'exec' task. If you can't move to sprouts for whatever reason, it's still possible, just a little more challenging. The first thing you'll need is a new version of the asunit3 framework from project sprouts (a temporary location while we prep for a new release of AsUnit): http://projectsprouts.googlecode.com/files/asunit3-1.5.zip The list of releases is here (generally, you want the latest): http://code.google.com/p/projectsprouts/downloads/list We created a new asunit.textui.XMLResultPrinter that can be assigned to your TestRunner before calling the start method something like this: import asunit.textui.XMLResultPrinter setPrinter(new XMLResultPrinter()); start(AllTests, null, TestRunner.SHOW_TRACE); If you're using the 'FlexRunner' with MXML, you'll need to call runner.setPrinter. Essentially, this class will emit JUnit XML test results which you can work with by: a) Read from the debug flash player log file and write somewhere on disk b) Merge with the Cruise Control output using CC 'merge' node (This will display AsUnit test results along side JUnit test results) c) Parse looking for failures / errors and throw an exception to cause a build failure I believe the cruise control 'exec' task has an attribute that will throw a cruise exception if a string is matched on the terminal. Unless you use Sprouts, you'll need to figure out how to get trace output into the terminal standard out. I believe there are a variety of options available for collecting ActionScript trace output and inserting it on stdout. Whew! With all that said, the absolute easiest way to get up and running with Continuous integration and ActionScript projects, is to use CruiseControl.rb and Project Sprouts. From the CruiseControl.rb perspective, a Sprouted ActionScript project looks an awful lot like a Rails project and it's all ready to go. Please let us know how this goes for you, or if you have more questions. Thanks, Luke Bayes http://www.asserttrue.com http://www.asunit.org http://www.projectsprouts.org |
|
From: Robert S. <rob...@gm...> - 2008-02-27 14:16:56
|
Anyone out there got a CI setup to run AsUnit with NAnt/CruiseControl.NET? Robert On Tue, Feb 26, 2008 at 3:47 PM, Luke Bayes <lb...@pa...> wrote: > Hey Tim, > > YES! > > The quickest and easiest way to get it done, is to drop Ant altogether > and move to Project Sprouts (http://www.projectsprouts.org). You can > still trigger a rake build from cruise control using the cruise 'exec' > task. > > If you can't move to sprouts for whatever reason, it's still possible, > just a little more challenging. > > The first thing you'll need is a new version of the asunit3 framework > from project sprouts (a temporary location while we prep for a new > release of AsUnit): > > http://projectsprouts.googlecode.com/files/asunit3-1.5.zip > > The list of releases is here (generally, you want the latest): > http://code.google.com/p/projectsprouts/downloads/list > > We created a new asunit.textui.XMLResultPrinter that can be assigned > to your TestRunner before calling the start method something like > this: > > import asunit.textui.XMLResultPrinter > setPrinter(new XMLResultPrinter()); > start(AllTests, null, TestRunner.SHOW_TRACE); > > If you're using the 'FlexRunner' with MXML, you'll need to call > runner.setPrinter. > > Essentially, this class will emit JUnit XML test results which you can > work with by: > > a) Read from the debug flash player log file and write somewhere on disk > b) Merge with the Cruise Control output using CC 'merge' node (This > will display AsUnit test results along side JUnit test results) > c) Parse looking for failures / errors and throw an exception to cause > a build failure > > I believe the cruise control 'exec' task has an attribute that will > throw a cruise exception if a string is matched on the terminal. > Unless you use Sprouts, you'll need to figure out how to get trace > output into the terminal standard out. I believe there are a variety > of options available for collecting ActionScript trace output and > inserting it on stdout. > > Whew! > > With all that said, the absolute easiest way to get up and running > with Continuous integration and ActionScript projects, is to use > CruiseControl.rb and Project Sprouts. From the CruiseControl.rb > perspective, a Sprouted ActionScript project looks an awful lot like a > Rails project and it's all ready to go. > > Please let us know how this goes for you, or if you have more questions. > > > Thanks, > > > Luke Bayes > http://www.asserttrue.com > http://www.asunit.org > http://www.projectsprouts.org > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > |
|
From: Luke B. <lb...@pa...> - 2008-03-13 23:42:17
|
Hey Robert, Do NAnt/CruiseControl.NET work with the same format of XML document that JUnit/Cruise Control work with? If so, we have an unannounced release of AsUnit that includes an XMLResultPrinter here: http://projectsprouts.googlecode.com/files/asunit3-1.5.zip You can check out the previous message to learn a little more about how to configure your TestRunner to use this ResultPrinter. Once that's done, you need to send that trace output to a console or to a file where your CI tool can read it. If that isn't the correct or expected XML format, please create a custom ResultPrinter that does work. Maybe CCNETResultPrinter? You can use the one in the package above as an example. The real crux though, is killing the Flash Player process when the test harness is complete. The flashplayer_task.rb Rake task included with Sprouts will do this only IF the outer nodes created by the XMLResultPrinter are encountered. Please let us know how this goes. Thanks, Luke |