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

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