My team is using flexunit and a CI server running Hudson. On a development system, everything runs fine, and we get the reports just like we need them. It also works fine on the CI server when just the flexunit task is run, but the build fails when the CI server tries to run a full build - the build tries to run the tests and clean to prepare for the next build, but the clean fails because there is a "rundll32.exe" process using one of the files and it can't be deleted. We tracked this process down to the one run by the flexunit task.
Our task is:
<target name="xci-test" depends="set-flex-coverage-home, prepare-domain-metadata-to-war, prepare-sounds-to-war, prepare-domain-metadata-for-testing, compile-unit-test-flex">
<echo>**** The flexunit target requires that you have the standalone flash player installed and configured to run .swf files automatically! ****</echo>
<mkdir dir="${dir.flexgui.test.output}"/>
<!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
<!-- Please see http://docs.flexunit.org/index.php?title=Ant_Task -->
<flexunit workingDir="${dir.flexgui.test.output}"
swf="${dir.flexgui.build.war}/${flex.swf.name}test.swf"
toDir="${dir.flexgui.test.output}"
haltonfailure="false" verbose="true" localTrusted="true"
port="11028" timeout="40000"/>
<!-- Generate readable JUnit-style reports -->
<junitreport todir="${dir.flexgui.test.output}">
<fileset dir="${dir.flexgui.test.output}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dir.flexgui.test.output}/"/>
</junitreport>
<sleep seconds="10"/>
</target>
I can reproduce this behavior on my dev machine by running "ant xci-test clean". We tried putting a sleep in to give the process time to shut down, no change. We attempted to use the 'command' option to the flexunit task to bypass the use of rundll32.exe, but then the flash player just hangs onto the file and the clean still fails. Since "ant xci-test" followed by "ant clean" works, we also tried running ant from within ant in order to force the process to stop, but that also didn't work. Any help on this would be greatly appreciated.
Thanks for your time,
Linden