You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

integration_tests.xml 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <?xml version="1.0"?>
  2. <project xmlns:antcontrib="antlib:net.sf.antcontrib"
  3. name="Vaadin Integration Tests" basedir="." default="integration-test-all">
  4. <!-- Import common targets -->
  5. <import file="../build/common.xml" />
  6. <!-- Target deploying demo.war -->
  7. <fail unless="test.integration.server" message="test.integration.server must be set for integration tests to run" />
  8. <fail unless="test.integration.user" message="test.integration.user must be set for integration tests to run" />
  9. <fail unless="test.integration.antfile" message="test.integration.antfile must be set for integration tests to run" />
  10. <!-- Test with these browsers -->
  11. <property name="test_browsers" value="winxp-firefox11" />
  12. <!-- Path to key file. Default value -->
  13. <property name="sshkey.file" value="id_dsa" />
  14. <!-- path and name for demo.war to be deployed -->
  15. <property name="demo.war" value="demo.war" />
  16. <!-- Host running Testbench RC or Testbench Hub. Default value -->
  17. <property name="com.vaadin.testbench.tester.host" value="127.0.0.1" />
  18. <!-- Base url where the testable application is deployed -->
  19. <property name="deployment.url" value="http://${test.integration.server}:8080" />
  20. <!-- ssh host values -->
  21. <property name="ant.hub" value="${test.integration.antfile}" />
  22. <property name="user" value="${test.integration.user}" />
  23. <property name="passphrase" value="" />
  24. <!-- Upload war to deploy to ssh host -->
  25. <target name="integration-test-upload-demo">
  26. <scp file="${demo.war}" todir="${user}@${test.integration.server}:integration-tests/servers/demo.war" keyfile="${sshkey.file}" passphrase="${passphrase}" />
  27. </target>
  28. <!-- Run basic integration test test -->
  29. <target name="integration-test-servlet">
  30. <fileset dir="integration-testscripts" id="html-test-files" includes="integration-test-${server-name}-servlet.html" />
  31. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  32. <subant target="run-tests" failonerror="false" antfile="test.xml">
  33. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  34. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  35. <property name="com.vaadin.testbench.deployment.url" value="${deployment.url}" />
  36. <property name="server.start.succeeded" value="1" />
  37. <property name="browsers" value="${test_browsers}" />
  38. <property name="testfiles" value="${testfiles}" />
  39. <property name="test-output-dir" value="../build/integration-test-output/${server-name}" />
  40. <property name="retries" value="0" />
  41. <fileset dir="." includes="test.xml" />
  42. </subant>
  43. </target>
  44. <target name="integration-test-theme">
  45. <subant target="run-tests" failonerror="false" antfile="test.xml">
  46. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  47. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  48. <property name="com.vaadin.testbench.deployment.url" value="${deployment.url}" />
  49. <property name="server.start.succeeded" value="1" />
  50. <property name="testfiles" value="${testfiles-theme}" />
  51. <property name="test-output-dir" value="../build/integration-test-output/${server-name}" />
  52. <fileset dir="." includes="test.xml" />
  53. </subant>
  54. </target>
  55. <!-- Run integration test on GAE -->
  56. <target name="integration-test-test-GAE">
  57. <fileset dir="integration-testscripts" id="html-test-files" includes="GoogleAppEngine/integration-test-GAE.html" />
  58. <pathconvert pathsep=" " property="test-GAE" refid="html-test-files" />
  59. <subant target="run-tests" failonerror="false" antfile="test.xml">
  60. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  61. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  62. <property name="com.vaadin.testbench.deployment.url" value="http://vaadin-integration-test.appspot.com/" />
  63. <property name="server.start.succeeded" value="1" />
  64. <property name="browsers" value="${test_browsers}" />
  65. <property name="testfiles" value="${test-GAE}" />
  66. <property name="test-output-dir" value="../build/integration-test-gae-output" />
  67. <fileset dir="." includes="test.xml" />
  68. </subant>
  69. </target>
  70. <target name="integration-test-deploy-to-GAE">
  71. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} deploy-to-GAE" />
  72. </target>
  73. <target name="integration-test-tomcat7">
  74. <antcall target="run-generic-integration-test">
  75. <param name="startDelay" value="10" />
  76. <param name="target-server" value="tomcat7" />
  77. </antcall>
  78. </target>
  79. <target name="integration-test-tomcat5">
  80. <antcall target="run-generic-integration-test">
  81. <param name="startDelay" value="10" />
  82. <param name="target-server" value="tomcat5" />
  83. </antcall>
  84. </target>
  85. <target name="integration-test-tomcat6">
  86. <antcall target="run-generic-integration-test">
  87. <param name="startDelay" value="10" />
  88. <param name="target-server" value="tomcat6" />
  89. </antcall>
  90. </target>
  91. <target name="integration-test-jetty5">
  92. <antcall target="run-generic-integration-test">
  93. <param name="target-server" value="jetty5" />
  94. </antcall>
  95. </target>
  96. <target name="integration-test-jetty6">
  97. <antcall target="run-generic-integration-test">
  98. <param name="target-server" value="jetty6" />
  99. </antcall>
  100. </target>
  101. <target name="integration-test-jetty7">
  102. <antcall target="run-generic-integration-test">
  103. <param name="target-server" value="jetty7" />
  104. </antcall>
  105. </target>
  106. <target name="integration-test-jetty8">
  107. <antcall target="run-generic-integration-test">
  108. <param name="startDelay" value="300" />
  109. <param name="target-server" value="jetty8" />
  110. </antcall>
  111. </target>
  112. <target name="integration-test-jboss4">
  113. <antcall target="run-generic-integration-test">
  114. <param name="startDelay" value="10" />
  115. <param name="target-server" value="jboss4" />
  116. </antcall>
  117. </target>
  118. <target name="integration-test-jboss5">
  119. <antcall target="run-generic-integration-test">
  120. <param name="startDelay" value="10" />
  121. <param name="target-server" value="jboss5" />
  122. </antcall>
  123. </target>
  124. <target name="integration-test-jboss6">
  125. <antcall target="run-generic-integration-test">
  126. <param name="startDelay" value="10" />
  127. <param name="target-server" value="jboss6" />
  128. </antcall>
  129. </target>
  130. <target name="integration-test-jboss7">
  131. <antcall target="run-generic-integration-test">
  132. <param name="startDelay" value="10" />
  133. <param name="target-server" value="jboss7" />
  134. </antcall>
  135. </target>
  136. <target name="integration-test-glassfish2">
  137. <antcall target="run-generic-integration-test">
  138. <param name="startDelay" value="10" />
  139. <param name="target-server" value="glassfish2" />
  140. </antcall>
  141. </target>
  142. <target name="integration-test-glassfish3">
  143. <antcall target="run-generic-integration-test">
  144. <param name="startDelay" value="10" />
  145. <param name="target-server" value="glassfish3" />
  146. </antcall>
  147. </target>
  148. <target name="integration-test-liferay6">
  149. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-6/integration-test-liferay-6.0.5.html" />
  150. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  151. <fileset dir="integration-testscripts" id="html-theme-files" includes="Liferay-6/Liferay6-theme.html" />
  152. <pathconvert pathsep=" " property="testfiles-theme" refid="html-theme-files" />
  153. <antcall target="run-generic-integration-test">
  154. <param name="startDelay" value="600" />
  155. <param name="target-server" value="liferay6" />
  156. </antcall>
  157. </target>
  158. <target name="integration-test-liferay5">
  159. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-5/integration-test-liferay-5.2.3-portlet2.html" />
  160. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  161. <antcall target="run-generic-integration-test">
  162. <param name="startDelay" value="600" />
  163. <param name="target-server" value="liferay5" />
  164. </antcall>
  165. </target>
  166. <target name="integration-test-liferay6ee">
  167. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-6EE/integration-test-liferay-6ee.html" />
  168. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  169. <fileset dir="integration-testscripts" id="html-theme-files" includes="Liferay-6EE/Liferay6EE-theme.html" />
  170. <pathconvert pathsep=" " property="testfiles-theme" refid="html-theme-files" />
  171. <antcall target="run-generic-integration-test">
  172. <param name="startDelay" value="600" />
  173. <param name="target-server" value="liferay6ee" />
  174. </antcall>
  175. </target>
  176. <target name="integration-test-gatein3">
  177. <fileset dir="integration-testscripts" id="html-test-files" includes="GateIn-3/integration-test-GateIn-3.1.0-portlet2.html" />
  178. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  179. <antcall target="run-generic-integration-test">
  180. <param name="startDelay" value="600" />
  181. <param name="test_browsers" value="winxp-googlechrome19" />
  182. <param name="target-server" value="gatein3" />
  183. </antcall>
  184. </target>
  185. <target name="integration-test-exo3">
  186. <fileset dir="integration-testscripts" id="html-test-files" includes="eXo-3/integration-test-eXo-3.0.3-portlet2.html" />
  187. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  188. <antcall target="run-generic-integration-test">
  189. <param name="startDelay" value="600" />
  190. <param name="test_browsers" value="winxp-googlechrome19" />
  191. <param name="target-server" value="exo3" />
  192. </antcall>
  193. </target>
  194. <target name="integration-test-weblogic9">
  195. <antcall target="run-generic-integration-test">
  196. <param name="startDelay" value="600" />
  197. <param name="target-port" value="7001" />
  198. <param name="target-server" value="weblogic9" />
  199. </antcall>
  200. </target>
  201. <target name="integration-test-websphere8">
  202. <antcall target="run-generic-integration-test">
  203. <param name="startDelay" value="600" />
  204. <param name="target-port" value="9080" />
  205. <param name="target-server" value="websphere8" />
  206. </antcall>
  207. </target>
  208. <target name="integration-test-weblogic10">
  209. <antcall target="run-generic-integration-test">
  210. <param name="startDelay" value="600" />
  211. <param name="target-port" value="7001" />
  212. <param name="target-server" value="weblogic10" />
  213. </antcall>
  214. </target>
  215. <target name="integration-test-weblogic12">
  216. <antcall target="run-generic-integration-test">
  217. <param name="startDelay" value="600" />
  218. <param name="target-port" value="7001" />
  219. <param name="target-server" value="weblogic12" />
  220. </antcall>
  221. </target>
  222. <target name="integration-test-weblogicPortal">
  223. <fileset dir="integration-testscripts" id="html-test-files" includes="weblogic-portal/integration-test-WebLogic-Portal-10.3.2-portlet2.html" />
  224. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  225. <antcall target="run-generic-integration-test">
  226. <param name="startDelay" value="600" />
  227. <param name="target-port" value="7001" />
  228. <param name="target-server" value="weblogicportal" />
  229. </antcall>
  230. </target>
  231. <target name="integration-test-GAE">
  232. <antcall target="integration-test-deploy-to-GAE" />
  233. <antcall target="integration-test-test-GAE" />
  234. </target>
  235. <!-- Upload demo, clean error screenshots and test deployment on all servers -->
  236. <target name="integration-test-all" depends="common.init-deps">
  237. <parallel>
  238. <antcontrib:trycatch property="tried">
  239. <try>
  240. <!-- Still running GAE test from the old server which requires its own lock -->
  241. <echo message="Getting lock" />
  242. <antcall target="integration-test-get-lock" />
  243. <echo message="Got lock" />
  244. <antcall target="integration-test-upload-demo" />
  245. <antcall target="run-integration-test">
  246. <param name="target-server" value="GAE" />
  247. </antcall>
  248. <antcall target="integration-test-clean" />
  249. <echo message="Getting lock" />
  250. <antcall target="integration-test-release-lock" />
  251. <echo message="Lock released" />
  252. </try>
  253. <catch>
  254. <echo message="Uploading of demo.war failed. ${tried}" />
  255. </catch>
  256. </antcontrib:trycatch>
  257. <antcall target="integration-test-liferay6" />
  258. <antcall target="integration-test-liferay6ee" />
  259. <antcall target="integration-test-exo3" />
  260. <antcall target="integration-test-weblogicPortal" />
  261. <antcall target="integration-test-liferay5" />
  262. <antcall target="integration-test-weblogic9" />
  263. <antcall target="integration-test-weblogic10" />
  264. <antcall target="integration-test-weblogic12" />
  265. <antcall target="integration-test-gatein3" />
  266. <antcall target="integration-test-glassfish2" />
  267. <antcall target="integration-test-glassfish3" />
  268. <antcall target="integration-test-jboss4" />
  269. <antcall target="integration-test-jboss5" />
  270. <antcall target="integration-test-jboss6" />
  271. <antcall target="integration-test-jboss7" />
  272. <antcall target="integration-test-jetty5" />
  273. <antcall target="integration-test-jetty6" />
  274. <antcall target="integration-test-jetty7" />
  275. <antcall target="integration-test-jetty8" />
  276. <antcall target="integration-test-tomcat5" />
  277. <antcall target="integration-test-tomcat6" />
  278. <antcall target="integration-test-tomcat7" />
  279. <antcall target="integration-test-websphere8" />
  280. </parallel>
  281. </target>
  282. <target name="do-run-generic-test">
  283. <property name="target-host" value="${target-server}.devnet.vaadin.com" />
  284. <property name="target-port" value="8080" />
  285. <antcontrib:if>
  286. <isset property="startDelay" />
  287. <then>
  288. <antcontrib:math result="sleepTime" datatype="int">
  289. <op op="rint">
  290. <op op="*">
  291. <num value="${startDelay}" />
  292. <op op="random" />
  293. </op>
  294. </op>
  295. </antcontrib:math>
  296. <echo>Delaying startup of ${target-server} with ${sleepTime} seconds</echo>
  297. <sleep seconds="${sleepTime}" />
  298. </then>
  299. </antcontrib:if>
  300. <scp todir="${user}@${target-host}:." keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" >
  301. <fileset dir="integration_base_files">
  302. <include name="*" />
  303. </fileset>
  304. </scp>
  305. <!-- trycatch probably not needed any more as it just fails with the original message and doesn't do anything in the finally block -->
  306. <antcontrib:trycatch property="error_message">
  307. <try>
  308. <!-- timeout in one hour (remote end should timeout in 55 minutes) -->
  309. <sshexec host="${target-host}" outputproperty="lock-output" timeout="3600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="chmod +x *.sh; ant -f deploy.xml get-lock" />
  310. <antcall target="echo-prefix">
  311. <param name="prefix" value="${target-server}: " />
  312. <param name="message" value="${lock-output}" />
  313. </antcall>
  314. <scp file="${demo.war}" todir="${user}@${target-host}:demo.war" keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" />
  315. <!-- timeout in 15 minutes -->
  316. <sshexec host="${target-host}" outputproperty="start-output" timeout="900000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml startup-and-deploy" failonerror="false" />
  317. <antcall target="echo-prefix">
  318. <param name="prefix" value="${target-server}: " />
  319. <param name="message" value="${start-output}" />
  320. </antcall>
  321. <fail message="${start-output}">
  322. <condition>
  323. <not>
  324. <contains string="${start-output}" substring="Demo deployed successfully" />
  325. </not>
  326. </condition>
  327. </fail>
  328. <copy file="integration-testscripts/common/integration_test.tpl" tofile="integration-testscripts/integration-test-${target-server}-servlet.html" overwrite="true" />
  329. <antcall target="integration-test-servlet">
  330. <param name="server-name" value="${target-server}" />
  331. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  332. </antcall>
  333. <!-- Run theme tests in all browsers if there's a property with the test files -->
  334. <antcontrib:if>
  335. <isset property="testfiles-theme" />
  336. <antcontrib:then>
  337. <antcall target="integration-test-theme">
  338. <param name="server-name" value="${target-server}" />
  339. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  340. </antcall>
  341. </antcontrib:then>
  342. </antcontrib:if>
  343. <!-- timeout in five minutes -->
  344. <sshexec host="${target-host}" outputproperty="stop-output" timeout="600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml shutdown-and-cleanup" failonerror="false" />
  345. <antcall target="echo-prefix">
  346. <param name="prefix" value="${target-server}: " />
  347. <param name="message" value="${stop-output}" />
  348. </antcall>
  349. </try>
  350. <catch>
  351. <fail message="${error_message}" />
  352. </catch>
  353. </antcontrib:trycatch>
  354. </target>
  355. <target name="echo-prefix">
  356. <antcontrib:propertyregex property="message-prefixed" input="${prefix}${message}" regexp="\n" replace="\0${prefix}" global="true" defaultValue="${prefix}${message}" />
  357. <echo message="${message-prefixed}" />
  358. </target>
  359. <target name="run-generic-integration-test">
  360. <concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
  361. <antcontrib:trycatch property="tried">
  362. <try>
  363. <antcall target="do-run-generic-test" />
  364. </try>
  365. <catch>
  366. <antcontrib:antcallback target="teamcity-escape" return="tried-escaped">
  367. <param name="returnTo" value="tried-escaped" />
  368. <param name="message" value="${tried}" />
  369. </antcontrib:antcallback>
  370. <concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']</concat>
  371. </catch>
  372. </antcontrib:trycatch>
  373. <concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
  374. </target>
  375. <target name="teamcity-escape">
  376. <property name="returnTo" value="return" />
  377. <!-- Should also perform other escaping (\u0085, \u2028 and \u2029) - see http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity -->
  378. <!-- Immutable properties -> needs to create a new one every time -->
  379. <antcontrib:propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" />
  380. <antcontrib:propertyregex property="details-escaped2" input="${details-escaped1}" regexp="\n" replace="|n" global="true" defaultValue="${details-escaped1}" />
  381. <antcontrib:propertyregex property="details-escaped3" input="${details-escaped2}" regexp="\r" replace="|r" global="true" defaultValue="${details-escaped2}" />
  382. <property name="${returnTo}" value="${details-escaped3}" />
  383. </target>
  384. <target name="run-integration-test">
  385. <concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
  386. <antcontrib:trycatch property="tried">
  387. <try>
  388. <antcall target="integration-test-${target-server}" />
  389. </try>
  390. <catch>
  391. <antcallback target="teamcity-escape" return="tried-escaped">
  392. <param name="returnTo" value="tried-escaped" />
  393. <param name="message" value="${tried}" />
  394. </antcallback>
  395. <concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']"</concat>
  396. </catch>
  397. </antcontrib:trycatch>
  398. <concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
  399. </target>
  400. <target name="integration-test-get-lock">
  401. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} get-lock" />
  402. </target>
  403. <target name="integration-test-release-lock">
  404. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} release-lock" />
  405. </target>
  406. <!-- Remove demo.war -->
  407. <target name="integration-test-clean">
  408. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} clean" />
  409. </target>
  410. </project>