FlexUnit and Continuous Integration Updates

Brian LeGros | January 19th, 2010 | programming  

This past weekend, I finished my port of the Hudson Xvnc plugin to the FlexUnit Ant task. I’m hoping this will help those who don’t have access to the plugin, or dont’ use Hudson, but want to execute headless builds using FlexUnit and Xvnc. In addition to this work, I’ve added a few wiki pages to the newly launched FlexUnit.org’s wiki instance. A break down of the all the features available in the FlexUnit Ant task can be found @ http://docs.flexunit.org/index.php?title=Ant_Task. Additionally, to see the Ant task in action in a few variations, check out the FlexUnit4SampleCIProject on Github; I also show a basic POM using Flexmojos and FlexUnit4. For a general culmination of FlexUnit and continuous integration experience for running headless builds, check out http://docs.flexunit.org/index.php?title=Continuous_Integration_Support. Hopefully this information can help to prevent some people from experiencing the painstaking lessons I had to go through.

Next I’m off to update the FlexUnit 4 CI builds to work with versioning as well as integrate the new FlexPMD (CPD, Metrics) to get some more sexy Hudson reporting going on. If you’re interested in seeing the latest rendition of our CI process, check out http://flexunit.digitalprimates.net.

Using Xvnc to create headless CI builds for Flex and AIR applications

Brian LeGros | December 20th, 2009 | programming  

Over the last year or so, I’ve worked to integrate xvfb into the projects I work with at the office and in the community to allow the execution of truly headless builds for Flex-based applications. Since the Flash Player and AIR require a windowing environment and typically unit and integration tests require this environment to be executed, integrating Flex into a CI process on Linux gets pretty hairy without having X-Windows support. Recently I’ve found myself switching from xvfb to Xvnc to more easily support headless builds in Flex. VNC server packages are pretty ubiquitous for most Linux distros, so getting something installed is pretty simple. What took me a couple of steps was getting setup based on the configuration of my CI server. In an effort to make searching a little simpler, here are the steps for using the Xvnc-plugin with Hudson on Ubuntu Desktop 8.10 with the default Tomcat 6 installation:

  1. Install the vnc4server package (i.e. – “apt-get install vnc4server”).
  2. Assuming the Ubuntu installation came with Tomcat 6 and is setup to run as the tomcat6 system user, do the following:
    1. Execute vncpassword as any user, following the prompts to set a password to be used by the “vncserver” command. This will create the “~/.vnc/password” file needed to run the vncserver command.
    2. Copy the file at ~/.vnc/password to /usr/shared/tomcat6/.vnc/password which is the default home directory for the tomcat6 user on the standard install of Ubuntu Desktop.
    3. Change the ownership rights on the “password” file to be owned and created by the “tomcat6″ user (i.e. – chown tomcat6:tomcat6 /usr/shared/.vnc/password)
    4. Edit /etc/init.d/tomcat6, adding a line to set the HOME environment variable to “/usr/shared/tomcat6″ (i.e. – export HOME=/usr/shared/tomcat6). Since “tomcat6″ is setup as a system user, from what I can tell, this environment variable is not set by default when a process is running as this user. The “vncserver” command will need this variable to determine where the “password” file is located to launch its process.
  3. If Tomcat is running as a standard user, execute the “vncserver” command using any display number (e.g. – vncserver :99) as the user. The command will force a prompt to enter a password to use for the server which will create the “~/.vnc/password” file with the appropriate ownership rights in the appropriate home directory.
  4. In Hudson, install the Xvnc-plugin for Hudson (http://wiki.hudson-ci.org/display/HUDSON/Xvnc+Plugin)
  5. OPTIONAL: In Hudson, under “Manage Hudson” -> “Configure system” -> “Xvnc”, set the “Base display number” field to 99. This is the base display number xvfb-run uses and I’m partial to reusing this setting.
  6. Under the configuration for you CI build, check the box labeled Run Xvnc during build.
  7. If all goes as expected, then your build should kick off the “vncserver :99″ command, set the DISPLAY environment variable to 99, execute your build to completion, and then execute “vncserver -kill :99″ to kill the Xvnc process.

Based on these steps, I’m am currently building Xvnc support into the FlexUnit4 Ant task for those who don’t use Hudson and can’t take advantage of the Xvnc-plugin. The Xvnc support is a basic mirror of what the plugin for Hudson aims to provide. Hopefully someone will find this footwork useful and save some time. I’m by no means a Linux guru, so if anyone has more insight, please feel free to share so others can benefit from your knowledge as well.

Happy building!

UPDATE: I’ve now tested and deployed the Xvnc support for the FlexUnit Ant task. Hopefully this will help anyone who’s not using Hudson but wants to take advantage of headless FlexUnit test executions using Xvnc.

FlexUnit 4 Beta 2 Released

Brian LeGros | August 24th, 2009 | news  

Today the 2nd beta release of FlexUnit4 was published. This release comes with a large list of bug fixes and improvements. This past weekend I burned the midnight oil with Mike and we buttoned up the FlexUnit4AntTasks project and I threw together a new sample project for FlexUnit4 showing how to integrate with Ant and Maven (via the Flex-Mojos plugin). Currently xvfb support isn’t available but we hope to add it in the next beta along with a few bug fixes and refactorings that we have time to finish. If you’re running your CI server on Windows using the Local System account, you should be able to take advantage of the new FlexUnit Ant task; the MacOS X and Linux crowd will have to work with source for now.

If your interested in more details, check out Mike’s latest blog post on the Beta 2 release.

Code and slides finally posted from FlexCamp Miami

Brian LeGros | March 29th, 2009 | conferences  

Sorry to everyone who’s been asking about a copy of my presentation from FlexCamp Miami. I’ve just posted the source and slides for my presentation @ http://svn.adogo.us/200903-FlexCampMiami/ along with Max, who had his stuff up pretty quickly after the conference. I wanted to take some time to add a better example of an integration test which is now available in the RestaurantGrid component project. What delayed me was finding an easy way to explain how to test the DataGrid embedded within the RestaurantGrid; I tried to provide the most basic of examples with and without the help of the Flex Automation API.

Hope this helps those who were interested; sorry again about the delay. If you have any questions, please don’t hesitate to contact me via comments or email me @ me at brianlegros dot com. Also, if you find yourself in the Orlando area, always feel free to drop by an Adogo meeting. This month we’ve got a great JavaScript topic being presented by Adam as well as Max giving his FlexCamp Miami presentation with, if we’re lucky, working AOP in AS3 via Loom! Check out the Adogo blog for more information on time and location. Hope you can make it!

FlexCamp Miami Wrap-up

Brian LeGros | March 6th, 2009 | conferences  

For a one day event, FlexCamp Miami had tons of information packed into its 8 sessions. Greg Wilson started us out with a great intro to some of the new features coming in Gumbo (Flex 4) followed by David Tucker digging down into the persistence side of AIR, along with some new 1.5 features. After the break, Max blew away the crowd with loom and some AS3 internals followed by Andrew Powell and some awesome examples of using Merapi to bring some deeper OS interaction to AIR. We broke for lunch and then Christian Saylor gave a really motivating presentation on the importance of UX for developers. I had to follow him with my CI presentation, which didn’t even compare and ran long, but then Jeremy Grelle swooped back in and kept everyone’s attention with Milestone 2 of the new Spring/BlazeDS integration (released this last Wednesday). Laura Arguello finished out the day with a cool introduction to Mate. Universal Mind did a great job with the event, lunch was good, and my brain is full.

I should have my code available on the Adogo SVN server this week, I’d just like to add an integration testing example before I commit it. Look for Max and my code/presentations there soon. Hopefully we can convince UM to have another one of these a little further North … say Orlando? I think I know a few Central Florida user groups that could help promote it.

NOTE: If you ever make your way down to Coral Gables, give Titanic Restaurant and Brewery a try. They’ve got some really tasty microbrews and even more delicious food. I recommend the Captain Smith’s Rye Ale, super great. For food, I had the Shrimp Po-boy which came with 6 huge tailed shrimp and a nice remoulade. Thanks to Greg for the great meal!

Fluint 1.1.0 Released!

Brian LeGros | February 12th, 2009 | programming  

Over the last few months, I’ve been working with Michael Labriola on the next minor version release of Fluint. Well, this evening Michael and I put the finishing touches on release 1.1.0. This release brought all of the changes I made to get Fluint working at the office for our CI process to the community. There are a couple of cool little gems that I think will be helpful for some:

  • Separation of failures and errors in test reporting (visual and XML).
  • XML compliant output with most CI servers as well as the JUnitReport task in Ant and the Surefire Reporting plugin in Maven.
  • Support in the Ant task for truly headless executions of the AIR Test Runner via xvfb-run.
  • Support for relative paths in the Ant task and AIR Test Runner.
  • Better error handling for non-compliant modules loaded into the AIR Test Runner.
  • LogBook integration for debugging
  • A big folder re-organization and Ant scripts to support developers when they need specialty builds.
  • Agreed upon a branching and tagging strategy so the community can have stable snapshots of source to build.

We probably should put together a ChangeLog wiki page, so that may be available soon. We did a few updates to the wiki, so stop by the Google Code site and check out the changes. Also, provide feedback on the discussion list, if there are features you’d like to see implemented, bugs that you find, or just general questions you need help with. People are great about helping on the list, so don’t feel discouraged.

This is my first major release of an OSS project that I’ve had code go into, so thanks to everyone who helped with the release, especially my wife for putting up with a lot of late nights. There is a lot more to come with Fluint over the next year that is going to be really exciting. Look for announcements during my presentation at FlexCamp Miami and on the discussion mailing list. Hope you enjoy the new release!

Adogo presentation went long

Brian LeGros | February 10th, 2009 | news  

Last night I gave my 2nd pass at my “Continous Integration” presentation that I will be giving at FlexCamp Miami in March. The presentation went an hour and forty minutes … yeah, it was really long winded. People were receptive to the content, I just think it was a lot to process in one session. Dan had some great suggestions about shortening the amount of time spent on locking strategies in source control, which should give me a lot of time back. I know the conference was looking for a testing topic and I gave them a CI topic, so I’ll probably also focus more on testing and examples than the rest of the content. After listening to myself on the recording, I also think I need laugh a little less at my own jokes, and be a little more professional; I’ll be working on that in the coming weeks.

If anyone who was at the meeting, or wants to watch the recording, has some time, I’d really be up for feedback on the presentation content and my presentation style. Feel free to let ‘er rip and don’t hold any punches. I can take it :*(

Presenting at the Adogo this month

Brian LeGros | February 3rd, 2009 | news  

It seems like every month, the Adogo and RAnDOM meetings creep up on me. That being said, we’ve pushed the Adogo meeting for February back to February 9th this month instead of yesterday, February 2nd, to try and make up some time to prep. I will be presenting on the topic of “Continuous Integration” (primer) and afterward we’ll be having a round-table discussion about what everyone’s been up to and working on. Should be a pretty lay back meeting and I promise to put everyone to sleep, so bring your pillows. This will be a practice run for my the presentation that I will be giving at FlexCamp Miami on March 6th, so if you like what you see (with, or without. the sexual overtones), you should try to make it down for a day of fun with Flex.

See ya Monday, if you can make it; if not, thanks for sparing me the embarrassment that was inevitable. :’(