Hi
I have two issues with Cruise stages.
I have a stage in cruise that executes a batch file (see ci\deploy-and-test.bat in cruise-config.xml file - I put his in the code section as the forum would not let ma attach it) which in turn runs an ANT script.
Inside the ANT script an exec task runs another batch file (to start JBOSS). The exec task is spawned in a new process.
As this is spawned in a new process the ANT script continues it's execution to eventually run some Twist tests. A Twist test subsequently fails (expectedly), and the main ANT script FAILS (as expected), but the Cruise stage hangs their in a running state.
If I remove the exec task from the ANT script and run the Cruise stage, the ANT task again fails when it runs the Twist test, and the main ANT script FAILS (as expected), but this time the Cruise stage completes BUT goes green stating it has passed (when I would expect cruise to interpet it as a failure).
I have attached the cruise config and here is the snippet of the ANT build file that exec's JBOSS.
<echo message="Starting JBoss...${container.start.executable} ${container.executable.start.args}"/>
<exec dir="${container.home}/bin" executable="${container.start.executable}" spawn="true">
<arg line="${container.executable.start.args}"/>
</exec>
Any help would be appreciated as our CI environment is useless while this is not functioning.
Thanks
Ade
Comment
Actually, I am guessing I have to kill off the process I spawned to start JBoss? to allow the Cruise stage to complete?
Is the second issue something to do with the error code returned from ANT (being 0 and not 1)?
Ade
Hi Ade, yes you can allow Cruise stage to complete by killing the JBoss process. But with Ant there is better way for doing this: use the parallel daemon tasks. For example:
<parallel>
<daemon>
<exec ... //start JBoss server, don't turn on spawn
</daemon>
<junit ... //run your tests
</parallel>
When Ant exists it will kill daemon processes.
For the second question, you got the right way, but a little different. It depends on the error code returned from your bat(ci\package-and-test.bat) not ANT, 0 for success or non-zero for failure.
I have a follow up question.
The second stage in my pipeline runs batch file that lauches ANT that executes some Twist tests. When the twist tests are executed against Internet Explorer (v7) browser, the tests don't start as the browser gives a 404 erroras follows:
Apache Tomcat/5.5 - Error report
message /selenium-server/core/RemoteRunner.html
description The requested resource (/selenium-server/core/RemoteRunner.html) is not available.
However, if I run the batch file from a command window passing in the same arguments as Cruise does and running it from the same working directory (as specified in the cruise config file), then it works perfectly. So something in the Cruise environment (or something I haven't set up) is preventing me from running twist tests in Internet Explorer.
Note: Everything works fine in Cruise when firefox is the browser used by Twist.
Any help would be appreciated.
Thanks
Ade
You can take a look at the browser url when the 404 error happens, see if it's http://localhost or http://ip_address...
There is a limitation in IE that accessing localhost can not use proxy. If that's the case you need to make sure your twist tests use http://ip_address/... as your browser url instead of http://localhost/...