flashmavenjenkinsflexmojosflexunit4

FlexUnit tests not running in Jenkins


i'm trying to build a flash app with unit tests through my local network jenkins server. I've set it up as a maven artifact and i'm using the flexmojos 6.0.1 maven plugin to build it. Everything seems to work flawlessly (even the unit tests) when I build it locally through my dev environment (intelliJ) or on the commandline. I've tried on both my client and server computer. Both work perfectly. But when I try to start the job I've created in jenkins, flexmojos fails to run the unit tests returning a java error: 'accept timed out'. If I disable the unit tests it builds properly in jenkins. The tests are written using flexunit 4.

My guess is that jenkins fails to open the generated testrunner.swf in the flash player and flexmojos times out because of it. The flash player exe is available on PATH.

I have searched the internet trying to find more information about this issue, but there seems to be very little info out there. Flexmojos does not seem to be very well documented and it's unclear whom is currently heading up the project (if anyone?). It's a very useful maven plugin though if you're working with flash.

I should mention that i'm working with windows on both the client and server. I imagined it would be easier to setup jenkins to run with unit tests in windows, since it's not a headless server and it's easier to work with flash in windows.

Have anyone had similar problems trying to get jenkins to run unit tests with flexmojos?


Solution

  • Turns out it was due to the fact that I was running jenkins as a windows service on the server machine. Apparently windows services don't have access to the desktop by default (which was required to launch the flash player). I don't know if this is a more recent addition to windows (i'm running it on W7)? You can give a service desktop access, but this will create a new desktop that only the service has access to (I guess). When I did that the testrunner.swf failed due to security sandbox issues. Instead of trying to sort that out I opted to run the jenkins WAR manually from the commandline. i.e. java -jar jenkins.war

    This worked like a charm and I can now run automated builds with unit tests. Hope this helps someone else. :)