Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

integration_tests.xml 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <?xml version="1.0"?>
  2. <project xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:ivy="antlib:org.apache.ivy.ant" name="Vaadin Integration Tests" basedir="." default="integration-test-all">
  3. <!-- Import common targets -->
  4. <import file="../common.xml" />
  5. <dirname file="${ant.file.Vaadin Integration Tests}" property="integration_test.dir" />
  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-firefox17-esr" />
  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. <!-- TestBench license parameter -->
  21. <property name="vaadin.testbench.developer.license" value="" />
  22. <property name="report.dir" location="${integration_test.dir}/result/reports-integration" />
  23. <!-- ssh host values -->
  24. <property name="ant.hub" value="${test.integration.antfile}" />
  25. <property name="user" value="${test.integration.user}" />
  26. <property name="passphrase" value="" />
  27. <ivy:resolve file="ivy.xml" conf="build, build-provided" />
  28. <ivy:cachepath pathid="classpath.tb3.lib" conf="build, build-provided" />
  29. <path id="classpath.tb3">
  30. <path location="target/test-classes" />
  31. <path refid="classpath.tb3.lib" />
  32. <path location="target/classes" />
  33. </path>
  34. <!-- Upload war to deploy to ssh host -->
  35. <target name="integration-test-upload-demo">
  36. <scp file="${demo.war}" todir="${user}@${test.integration.server}:integration-tests/servers/demo.war" keyfile="${sshkey.file}" passphrase="${passphrase}" />
  37. </target>
  38. <!-- Run basic integration test test -->
  39. <target name="legacy-integration-test">
  40. <fail unless="testfiles" message="You need to specify the files to run using the 'testfiles' property" />
  41. <subant target="run-tb2-tests" failonerror="false" antfile="test.xml">
  42. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  43. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  44. <property name="com.vaadin.testbench.deployment.url" value="${deployment.url}" />
  45. <property name="server.start.succeeded" value="1" />
  46. <property name="browsers" value="${test_browsers}" />
  47. <property name="testfiles" value="${testfiles}" />
  48. <property name="test-output-dir" value="${integration_test.dir}/result/integration-test-output/${server-name}" />
  49. <property name="retries" value="0" />
  50. <property name="report.qualifier" value="integration-tb2/${server-name}" />
  51. <fileset dir="." includes="test.xml" />
  52. </subant>
  53. </target>
  54. <target name="integration-test-theme">
  55. <subant target="run-tb2-tests" failonerror="false" antfile="test.xml">
  56. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  57. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  58. <property name="com.vaadin.testbench.deployment.url" value="${deployment.url}" />
  59. <property name="server.start.succeeded" value="1" />
  60. <property name="testfiles" value="${testfiles-theme}" />
  61. <property name="test-output-dir" value="${integration_test.dir}/result/integration-test-output/${server-name}" />
  62. <property name="report.qualifier" value="integration-theme-tb2/${server-name}" />
  63. <fileset dir="." includes="test.xml" />
  64. </subant>
  65. </target>
  66. <target name="run-tb3-servlet-test">
  67. <antcall target="run-tb3-test" inheritall="true">
  68. <param name="junit.test.suite" value="com.vaadin.tests.tb3.ServletIntegrationTests" />
  69. </antcall>
  70. </target>
  71. <target name="run-tb3-test">
  72. <fail unless="server-name" message="Server name must be defined in server-name" />
  73. <fail unless="deployment.url" message="Deplyoment url must be defined in deployment.url" />
  74. <fail unless="com.vaadin.testbench.screenshot.directory" message="Screenshot directory must be defined in com.vaadin.testbench.screenshot.directory" />
  75. <property name="server.report.dir" location="${report.dir}/integration-test-tb3/${server-name}" />
  76. <!-- The junit task does not create the report dir... -->
  77. <mkdir dir="${server.report.dir}" />
  78. <junit showoutput="no" printsummary="no" fork="yes">
  79. <formatter type="xml" />
  80. <classpath refid="classpath.tb3" />
  81. <jvmarg value="-Dcom.vaadin.testbench.screenshot.directory=${com.vaadin.testbench.screenshot.directory}" />
  82. <jvmarg value="-Ddeployment.url=${deployment.url}" />
  83. <jvmarg value="-Dserver-name=${server-name}" />
  84. <jvmarg value="-Djava.awt.headless=true" />
  85. <jvmarg value="-Ddemo.war=${demo.war}" />
  86. <jvmarg value="-Dvaadin.testbench.developer.license=${vaadin.testbench.developer.license}" />
  87. <test name="${junit.test.suite}" todir="${server.report.dir}" />
  88. </junit>
  89. </target>
  90. <target name="integration-test-tomcat7">
  91. <antcall target="run-generic-integration-test">
  92. <param name="startDelay" value="10" />
  93. <param name="target-server" value="tomcat7" />
  94. </antcall>
  95. </target>
  96. <target name="integration-test-tomcat7apacheproxy">
  97. <antcall target="run-generic-integration-test">
  98. <param name="startDelay" value="10" />
  99. <param name="target-server" value="tomcat7apacheproxy" />
  100. </antcall>
  101. </target>
  102. <target name="integration-test-tomcat8">
  103. <antcall target="run-generic-integration-test">
  104. <param name="startDelay" value="10" />
  105. <param name="target-server" value="tomcat8" />
  106. </antcall>
  107. </target>
  108. <target name="integration-test-osgi">
  109. <antcall target="run-generic-integration-test">
  110. <param name="startDelay" value="10" />
  111. <param name="target-server" value="osgi" />
  112. </antcall>
  113. </target>
  114. <target name="integration-test-tomcat6">
  115. <antcall target="run-generic-integration-test">
  116. <param name="startDelay" value="10" />
  117. <param name="target-server" value="tomcat6" />
  118. </antcall>
  119. </target>
  120. <target name="integration-test-jetty7">
  121. <antcall target="run-generic-integration-test">
  122. <param name="target-server" value="jetty7" />
  123. </antcall>
  124. </target>
  125. <target name="integration-test-jetty8">
  126. <antcall target="run-generic-integration-test">
  127. <param name="startDelay" value="300" />
  128. <param name="target-server" value="jetty8" />
  129. </antcall>
  130. </target>
  131. <target name="integration-test-jetty9">
  132. <antcall target="run-generic-integration-test">
  133. <param name="startDelay" value="300" />
  134. <param name="target-server" value="jetty9" />
  135. </antcall>
  136. </target>
  137. <target name="integration-test-jboss4">
  138. <antcall target="run-generic-integration-test">
  139. <param name="startDelay" value="10" />
  140. <param name="target-server" value="jboss4" />
  141. </antcall>
  142. </target>
  143. <target name="integration-test-jboss5">
  144. <antcall target="run-generic-integration-test">
  145. <param name="startDelay" value="10" />
  146. <param name="target-server" value="jboss5" />
  147. </antcall>
  148. </target>
  149. <target name="integration-test-jboss6">
  150. <antcall target="run-generic-integration-test">
  151. <param name="startDelay" value="10" />
  152. <param name="target-server" value="jboss6" />
  153. </antcall>
  154. </target>
  155. <target name="integration-test-jboss7">
  156. <antcall target="run-generic-integration-test">
  157. <param name="startDelay" value="10" />
  158. <param name="target-server" value="jboss7" />
  159. </antcall>
  160. </target>
  161. <target name="integration-test-jboss-eap6">
  162. <antcall target="run-generic-integration-test">
  163. <param name="startDelay" value="10" />
  164. <param name="target-server" value="jbosseap6" />
  165. </antcall>
  166. </target>
  167. <target name="integration-test-wildfly8">
  168. <antcall target="run-generic-integration-test">
  169. <param name="startDelay" value="10" />
  170. <param name="target-server" value="wildfly8" />
  171. </antcall>
  172. </target>
  173. <target name="integration-test-wildfly9">
  174. <antcall target="run-generic-integration-test">
  175. <param name="startDelay" value="10" />
  176. <param name="target-server" value="wildfly9" />
  177. </antcall>
  178. </target>
  179. <target name="integration-test-wildfly10">
  180. <antcall target="run-generic-integration-test">
  181. <param name="startDelay" value="10" />
  182. <param name="target-server" value="wildfly10" />
  183. </antcall>
  184. </target>
  185. <target name="integration-test-wildfly9-nginx">
  186. <antcall target="run-generic-integration-test">
  187. <param name="startDelay" value="10" />
  188. <param name="target-server" value="wildfly9-nginx" />
  189. <param name="target-port" value="80" />
  190. </antcall>
  191. </target>
  192. <target name="integration-test-glassfish3">
  193. <antcall target="run-generic-integration-test">
  194. <param name="startDelay" value="10" />
  195. <param name="target-server" value="glassfish3" />
  196. </antcall>
  197. </target>
  198. <target name="integration-test-glassfish4">
  199. <antcall target="run-generic-integration-test">
  200. <param name="startDelay" value="10" />
  201. <param name="target-server" value="glassfish4" />
  202. </antcall>
  203. </target>
  204. <target name="integration-test-liferay6">
  205. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-6/integration-test-liferay-6.0.5.html" />
  206. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  207. <antcall target="run-generic-integration-test">
  208. <param name="startDelay" value="600" />
  209. <param name="test_browsers" value="winxp-firefox17-esr" />
  210. <param name="target-server" value="liferay6" />
  211. </antcall>
  212. </target>
  213. <target name="integration-test-liferay6-theme">
  214. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-6/Liferay6-and-6EE-theme-deploy.html" />
  215. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  216. <fileset dir="integration-testscripts" id="html-theme-files" includes="Liferay-6/Liferay6-theme.html" />
  217. <pathconvert pathsep=" " property="testfiles-theme" refid="html-theme-files" />
  218. <antcall target="run-generic-integration-test">
  219. <param name="startDelay" value="600" />
  220. <param name="test_browsers" value="winxp-firefox17-esr" />
  221. <param name="target-server" value="liferay6" />
  222. </antcall>
  223. </target>
  224. <target name="integration-test-websphere8">
  225. <antcall target="run-generic-integration-test">
  226. <param name="startDelay" value="600" />
  227. <param name="target-port" value="9080" />
  228. <param name="target-server" value="websphere8" />
  229. </antcall>
  230. </target>
  231. <target name="integration-test-websphereportal8">
  232. <concat>##teamcity[testStarted name='websphereportal8' flowId='websphereportal8']</concat>
  233. <antcall target="run-tb3-test" inheritall="true">
  234. <param name="junit.test.suite" value="com.vaadin.tests.integration.WebSpherePortalIntegrationTest" />
  235. <param name="server-name" value="websphereportal8" />
  236. <!-- Fill out dummy values for params required by run-tb3-test target -->
  237. <param name="test.integration.server" value="" />
  238. <param name="test.integration.user" value="" />
  239. <param name="test.integration.antfile" value="" />
  240. </antcall>
  241. <concat>##teamcity[testFinished name='websphereportal8' flowId='websphereportal8']"</concat>
  242. </target>
  243. <target name="integration-test-weblogic10">
  244. <antcall target="run-generic-integration-test">
  245. <param name="startDelay" value="600" />
  246. <param name="target-port" value="7001" />
  247. <param name="target-server" value="weblogic10" />
  248. </antcall>
  249. </target>
  250. <target name="integration-test-weblogic12">
  251. <antcall target="run-generic-integration-test">
  252. <param name="startDelay" value="600" />
  253. <param name="target-port" value="7001" />
  254. <param name="target-server" value="weblogic12" />
  255. </antcall>
  256. </target>
  257. <target name="integration-test-weblogicPortal">
  258. <fileset dir="integration-testscripts" id="html-test-files" includes="weblogic-portal/integration-test-WebLogic-Portal-10.3.2-portlet2.html" />
  259. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  260. <antcall target="run-generic-integration-test">
  261. <param name="startDelay" value="600" />
  262. <param name="target-port" value="7001" />
  263. <param name="target-server" value="weblogicportal" />
  264. </antcall>
  265. </target>
  266. <!-- Upload demo, clean error screenshots and test deployment on all
  267. servers -->
  268. <target name="integration-test-all" unless="tests.integration.skip">
  269. <property name="passphrase" value="${passphrase}" />
  270. <fail unless="sshkey.file" message="You must define an ssh.keyfile parameter" />
  271. <fail unless="com.vaadin.testbench.screenshot.directory" message="You must define a com.vaadin.testbench.screenshot.directory parameter" />
  272. <delete dir="${report.dir}" />
  273. <mkdir dir="${report.dir}" />
  274. <parallel>
  275. <antcall target="integration-test-liferay6" />
  276. <antcall target="integration-test-liferay6-theme" />
  277. <antcall target="integration-test-weblogicPortal" />
  278. <antcall target="integration-test-weblogic10" />
  279. <antcall target="integration-test-weblogic12" />
  280. <antcall target="integration-test-glassfish3" />
  281. <antcall target="integration-test-glassfish4" />
  282. <antcall target="integration-test-jboss4" />
  283. <antcall target="integration-test-jboss5" />
  284. <antcall target="integration-test-jboss6" />
  285. <antcall target="integration-test-jboss7" />
  286. <antcall target="integration-test-jboss-eap6" />
  287. <antcall target="integration-test-wildfly8" />
  288. <antcall target="integration-test-wildfly9" />
  289. <antcall target="integration-test-wildfly10" />
  290. <antcall target="integration-test-jetty7" />
  291. <antcall target="integration-test-jetty8" />
  292. <antcall target="integration-test-jetty9" />
  293. <antcall target="integration-test-tomcat6" />
  294. <antcall target="integration-test-tomcat7" />
  295. <antcall target="integration-test-tomcat8" />
  296. <antcall target="integration-test-osgi" />
  297. <antcall target="integration-test-tomcat7apacheproxy" />
  298. <antcall target="integration-test-websphere8" />
  299. </parallel>
  300. </target>
  301. <target name="do-run-generic-test">
  302. <property name="target-host" value="${target-server}.devnet.vaadin.com" />
  303. <property name="target-port" value="8080" />
  304. <antcontrib:if>
  305. <isset property="startDelay" />
  306. <then>
  307. <antcontrib:math result="sleepTime" datatype="int">
  308. <op op="rint">
  309. <op op="*">
  310. <num value="${startDelay}" />
  311. <op op="random" />
  312. </op>
  313. </op>
  314. </antcontrib:math>
  315. <echo>Delaying startup of ${target-server} with ${sleepTime} seconds</echo>
  316. <sleep seconds="${sleepTime}" />
  317. </then>
  318. </antcontrib:if>
  319. <scp todir="${user}@${target-host}:." keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}">
  320. <fileset dir="integration_base_files">
  321. <include name="*" />
  322. </fileset>
  323. </scp>
  324. <!-- trycatch probably not needed any more as it just fails with
  325. the original message and doesn't do anything in the finally block -->
  326. <antcontrib:trycatch property="error_message">
  327. <try>
  328. <!-- timeout in one hour (remote end should timeout in 55
  329. minutes) -->
  330. <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" />
  331. <antcall target="echo-prefix">
  332. <param name="prefix" value="${target-server}: " />
  333. <param name="message" value="${lock-output}" />
  334. </antcall>
  335. <scp file="${demo.war}" todir="${user}@${target-host}:demo.war" keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" />
  336. <!-- timeout in 15 minutes -->
  337. <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" />
  338. <antcall target="echo-prefix">
  339. <param name="prefix" value="${target-server}: " />
  340. <param name="message" value="${start-output}" />
  341. </antcall>
  342. <fail message="${start-output}">
  343. <condition>
  344. <not>
  345. <contains string="${start-output}" substring="Demo deployed successfully" />
  346. </not>
  347. </condition>
  348. </fail>
  349. <antcontrib:if>
  350. <isset property="testfiles" />
  351. <antcontrib:then>
  352. <echo>Starting legacy (TB2) test for ${target-server}</echo>
  353. <antcall target="legacy-integration-test">
  354. <param name="server-name" value="${target-server}" />
  355. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  356. </antcall>
  357. </antcontrib:then>
  358. <antcontrib:else>
  359. <echo>Starting TB3 test for ${target-server}</echo>
  360. <antcall target="run-tb3-servlet-test">
  361. <param name="server-name" value="${target-server}" />
  362. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  363. </antcall>
  364. </antcontrib:else>
  365. </antcontrib:if>
  366. <!-- Run theme tests in all browsers if there's a property
  367. with the test files -->
  368. <antcontrib:if>
  369. <isset property="testfiles-theme" />
  370. <antcontrib:then>
  371. <antcall target="integration-test-theme">
  372. <param name="server-name" value="${target-server}" />
  373. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  374. </antcall>
  375. </antcontrib:then>
  376. </antcontrib:if>
  377. <!-- timeout in five minutes -->
  378. <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" />
  379. <antcall target="echo-prefix">
  380. <param name="prefix" value="${target-server}: " />
  381. <param name="message" value="${stop-output}" />
  382. </antcall>
  383. </try>
  384. <catch>
  385. <fail message="${error_message}" />
  386. </catch>
  387. </antcontrib:trycatch>
  388. </target>
  389. <target name="echo-prefix">
  390. <antcontrib:propertyregex property="message-prefixed" input="${prefix}${message}" regexp="\n" replace="\0${prefix}" global="true" defaultValue="${prefix}${message}" />
  391. <echo message="${message-prefixed}" />
  392. </target>
  393. <target name="run-generic-integration-test">
  394. <concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
  395. <antcontrib:trycatch property="tried">
  396. <try>
  397. <antcall target="do-run-generic-test" />
  398. </try>
  399. <catch>
  400. <antcontrib:antcallback target="teamcity-escape" return="tried-escaped">
  401. <param name="returnTo" value="tried-escaped" />
  402. <param name="message" value="${tried}" />
  403. </antcontrib: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. </antcontrib:trycatch>
  407. <concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
  408. </target>
  409. <target name="teamcity-escape">
  410. <property name="returnTo" value="return" />
  411. <!-- Should also perform other escaping (\u0085, \u2028 and \u2029)
  412. - see http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity -->
  413. <!-- Immutable properties -> needs to create a new one every time -->
  414. <antcontrib:propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" />
  415. <antcontrib:propertyregex property="details-escaped2" input="${details-escaped1}" regexp="\n" replace="|n" global="true" defaultValue="${details-escaped1}" />
  416. <antcontrib:propertyregex property="details-escaped3" input="${details-escaped2}" regexp="\r" replace="|r" global="true" defaultValue="${details-escaped2}" />
  417. <property name="${returnTo}" value="${details-escaped3}" />
  418. </target>
  419. <target name="run-integration-test">
  420. <concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
  421. <antcontrib:trycatch property="tried">
  422. <try>
  423. <antcall target="integration-test-${target-server}" />
  424. </try>
  425. <catch>
  426. <antcallback target="teamcity-escape" return="tried-escaped">
  427. <param name="returnTo" value="tried-escaped" />
  428. <param name="message" value="${tried}" />
  429. </antcallback>
  430. <concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']"</concat>
  431. </catch>
  432. </antcontrib:trycatch>
  433. <concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
  434. </target>
  435. <target name="integration-test-get-lock">
  436. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} get-lock" />
  437. </target>
  438. <target name="integration-test-release-lock">
  439. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} release-lock" />
  440. </target>
  441. <!-- Remove demo.war -->
  442. <target name="integration-test-clean">
  443. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} clean" />
  444. </target>
  445. </project>