In the absence of a Maven plugin for Sahi, what's the easiest way to run Sahi tests from Hudson?
Asked
Active
Viewed 2,774 times
3
-
Did you consider using the ant task? – Pascal Thivent Nov 10 '10 at 06:15
-
2FYI: "sahi" turns out to be the indian word for "correct": http://translate.google.com/#en|hi|sah%20hee – Zabba Nov 10 '10 at 07:33
-
+1 for the right translation :) – Sagar Nov 10 '10 at 14:22
-
@Pascal: I'll consider anything that works! :-) We mainly use Maven, but if Ant's the easiest way, then so be it. Let's see what other ideas people have. – Andrew Swan Nov 11 '10 at 02:02
2 Answers
6
You do have a tutorial for integrating Hudson with Sahi, but it is based on a free-style project, and a Ant task (as Pascal Thivent commented)
with zkdemo.xml
and other Sahi ant tasks detailed here:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="bids" default="runfftests">
<property environment="env"/>
<property name="sahi.home" value="${env.SAHI_HOME}" location="/mnt/sda4/Sahi/sahi/" />
<property name="user.data" value="${env.SAHI_USERDATA_DIR}" location="/mnt/sda4/Sahi/sahi/userdata" />
<property name="urlbase" value="http://www.google.com/"/>
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="${sahi.home}/lib/ant-sahi.jar"/>
<target name="runfftests">
<antcall target="startsahi"/>
<sleep seconds="4"/>
<sahi suite="${user.data}/scripts/my.suite"
browser="/usr/bin/firefox"
baseurl="${urlbase}"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="firefox"
threads="3">
</sahi>
<sleep seconds="4"/>
<antcall target="stopsahi"/>
<sleep seconds="4"/>
<antcall target="failsahi"/>
</target>
<target name="failsahi" if="sahi.failed">
<fail message="Sahi tests failed!"/>
</target>
<target name="startsahi" description="start sahi proxy">
<java classname="net.sf.sahi.Proxy" fork="true" spawn="true" dir="${sahi.home}">
<!--<env key="MOZ_NO_REMOTE" value="1"/>-->
<classpath location="${sahi.home}/lib/sahi.jar">
<fileset dir="${sahi.home}/extlib" includes="**/*.jar"/>
</classpath>
<arg value="${sahi.home}" id="basePath"/>
<arg value="${user.data}" id="userdataPath"/>
</java>
</target>
<target name="stopsahi" description="stop sahi server">
<sahi stop="true" sahihost="localhost" sahiport="9999"/>
</target>
</project>
-1
you can use maven Surefire plugin call sahi junit test case, then integrated with Jenkin server

ming
- 1