forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-test-tck.xml
184 lines (148 loc) · 6.58 KB
/
build-test-tck.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0"?>
<project basedir="." default="test" name="portal-test-tck" xmlns:antelope="antlib:ise.antelope.tasks" xmlns:if="ant:if">
<import file="build-test.xml" />
<fail message="Please set the property ${tck.home}." unless="tck.home" />
<target name="clean-up-tck">
<exec dir="${tck.home}/.." executable="git" failonerror="false">
<arg value="apply" />
<arg value="--reverse" />
<arg value="${project.dir}/tools/tck/pluto-patch.diff" />
</exec>
</target>
<target name="prepare-tck">
<!--
Prepare TCK target is expected by CI.
-->
<echo>prepare-tck</echo>
</target>
<target name="prepare-tck-app-server">
<antcall target="prepare-portal-ssl" />
<propertycopy from="app.server.${app.server.type}.classes.portal.dir" name="app.server.classes.portal.dir" override="true" />
<get-database-property property.name="database.version" />
<replace
file="${app.server.dir}/webapps/ROOT/WEB-INF/web.xml"
token="<session-timeout>15</session-timeout>"
value="<session-timeout>${test.session.timeout[tck]}</session-timeout>"
/>
<antcall if:set="env.JENKINS_HOME" target="prepare-portal-ext-properties">
<param name="app.server.classes.portal.dir" value="${app.server.classes.portal.dir}" />
</antcall>
<echo append="true" file="${app.server.classes.portal.dir}/portal-ext.properties"><![CDATA[
browser.launcher.url=
javascript.single.page.application.enabled=false
module.framework.auto.deploy.interval=2000
setup.wizard.enabled=false
terms.of.use.required=false
theme.portlet.decorate.default=false
users.reminder.queries.enabled=false
users.reminder.queries.custom.question.enabled=false
web.server.https.port=8443]]></echo>
<exec dir="${tck.home}/.." executable="git" failonerror="true">
<arg value="stash" />
</exec>
<!--
Due to a Liferay-specific performance optimization, the Portlet Hub dependency must be
configured statically in order for top_head.jsp to output render data.
-->
<exec dir="${tck.home}/.." executable="git" failonerror="true">
<arg value="apply" />
<arg value="${project.dir}/tools/tck/pluto-patch.diff" />
</exec>
<execute dir="${tck.home}/..">
mvn -P all,liferay clean install
</execute>
<copy
flatten="true"
todir="${liferay.home}/deploy/"
>
<fileset
dir="${tck.home}"
includes="**/target/tck-*.war"
/>
</copy>
<if>
<not>
<isset property="env.JENKINS_HOME" />
</not>
<then>
<update-gradle-properties />
</then>
</if>
<echo
file="${liferay.home}/osgi/configs/com.liferay.portlet.tck.bridge.configuration.PortletTCKBridgeConfiguration.config"
>configFile="${tck.home}/deploy/target/deploy-files/pluto-portal-driver-config.xml"</echo
>
<gradle-execute dir="modules/test/portlet-tck-bridge" task="deploy" />
<propertycopy from="app.server.${app.server.type}.bin.dir" name="app.server.bin.dir" override="true" />
<prepare-selenium-login-config />
<antcall inheritall="false" target="start-app-server">
<param name="app.server.bin.dir" value="${app.server.bin.dir}" />
</antcall>
</target>
<target name="run-tck-tests">
<tempfile
createfile="true"
deleteonexit="true"
destDir="${project.dir}/tools/tck"
prefix="tck-tests_"
property="tck.tests.xml"
suffix=".xml"
/>
<copy
file="${tck.home}/driver/target/classes/generated-resources/xml/final/test.xml"
overwrite="true"
tofile="${tck.tests.xml}"
/>
<xmltask preserveType="true" source="${project.dir}/tools/tck/htmlunit-tests.xml">
<call path="//*[local-name()='entry'][@key]">
<param name="key" path="@key" />
<actions>
<replaceregexp
file="${tck.tests.xml}"
flags="gis"
match="<entry[^>]+key="@{key}"[^>]*>[^<]*</entry>"
replace=""
/>
</actions>
</call>
</xmltask>
<var name="tck.login.url" value="http://localhost:8080/group/[email protected]" />
<var name="tck.properties" value="-Dtest.context.base='${test.context.base[tck]}' -Dtest.server.username.id='${test.server.username.id[tck]}' -Dtest.server.username='${test.server.username[tck]}' -Dtest.server.password.id='${test.server.password.id[tck]}' -Dtest.server.password='${test.server.password[tck]}' -Dtest.timeout='${test.timeout[tck]}' -Dtest.ignore.list.file=${project.dir}/tools/tck/ignoredTestCases.xml -Dtest.non.exclusive.file=${project.dir}/tools/tck/nonExclusiveTestCases.xml -Dtest.server.login.url=${tck.login.url}" />
<execute dir="${tck.home}" failonerror="true">
mvn -Pliferay,run-tck -Djava.awt.headless=true ${tck.properties} -Dtest.browser=htmlunit -Dtest.browser.binary= -Dtest.browser.webDriver= -Dtest.list.file=${project.dir}/tools/tck/htmlunit-tests.xml test
</execute>
<if>
<available file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml" />
<then>
<mkdir dir="${project.dir}/tools/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/tools/tck/test-results/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver-htmlunit.xml"
/>
</then>
<else>
<fail message="No TCK tests were run with HTMLUnit." />
</else>
</if>
<prepare-chrome-driver />
<propertycopy from="browser.${browser.type[tck]}.version" name="tck.browser.version" silent="true" />
<propertycopy from="browser.${browser.type[tck]}.bin.file[86.0]" name="tck.browser.bin.file" silent="true" />
<propertycopy from="selenium.${browser.type[tck]}.driver.executable" name="tck.selenium.browser.driver.executable" silent="true" />
<execute dir="${tck.home}" failonerror="true">
mvn -Pliferay,run-tck -Djava.awt.headless=true ${tck.properties} -Dtest.browser=${browser.type[tck]} -Dtest.browser.binary=${tck.browser.bin.file} -Dtest.browser.webDriver=${project.dir}/tools/tck/../${selenium.executable.dir.name}${tck.selenium.browser.driver.executable} -Dtest.list.file=${tck.tests.xml} -Dtest.server.login.url=${tck.login.url} test
</execute>
<if>
<available file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml" />
<then>
<mkdir dir="${project.dir}/tools/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/tools/tck/test-results/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver-${browser.type[tck]}.xml"
/>
</then>
<else>
<fail message="No TCK tests were run with ${browser.type[tck]}." />
</else>
</if>
</target>
</project>