-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test-tck.xml
221 lines (178 loc) · 7.02 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?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="prepare-tck">
<!-- Prepare TCK target is expected by CI. -->
<echo>prepare-tck</echo>
</target>
<target name="prepare-tck-app-server">
<propertycopy
from="app.server.${app.server.type}.bin.dir"
name="app.server.bin.dir" override="true"
/>
<replaceregexp
flags="gm"
match="[-]XX[:]MaxMetaspaceSize[=][0-9]+[a-zA-Z]"
replace="-XX:MaxMetaspaceSize=1024m"
>
<fileset dir="${app.server.bin.dir}">
<include name="setenv.*"/>
</fileset>
</replaceregexp>
<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>30</session-timeout>"
value="<session-timeout>${test.session.timeout[tck]}</session-timeout>"
/>
<antcall 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
layout.parallel.render.enable=false
module.framework.auto.deploy.interval=2000
session.timeout=${test.session.timeout[tck]}
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}/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-V*.war"
/>
</copy>
<update-gradle-properties />
<gradle-execute dir="modules/test/portlet-tck-theme" task="deploy" />
<propertycopy
from="app.server.${app.server.type}.bin.dir"
name="app.server.bin.dir" override="true"
/>
<antcall inheritall="false" target="start-app-server">
<param name="app.server.bin.dir" value="${app.server.bin.dir}" />
</antcall>
<delete file="${liferay.home}/osgi/modules/com.liferay.chat.api.jar" />
<delete file="${liferay.home}/osgi/modules/com.liferay.chat.service.jar" />
<delete file="${liferay.home}/osgi/modules/com.liferay.chat.web.jar" />
<echo
file="${liferay.home}/osgi/modules/com.liferay.portlet.tck.bridge.configuration.PortletTCKBridgeConfiguration.cfg"
>tckDeployFilesDir=${tck.home}/deploy/target/deploy-files</echo>
<gradle-execute dir="modules/test/portlet-tck-bridge" task="deploy" />
<wait-for-app-server-log-message log.message="Portlet TCK Bridge is ready" />
</target>
<target name="run-tck-tests">
<tempfile
createfile="true"
deleteonexit="true"
destDir="${project.dir}/tck"
prefix="tck-tests_"
property="tck.tests.xml"
suffix=".xml"
/>
<copy
file="${tck.home}/driver/target/classes/generated-resources/xml/final/test.xml"
tofile="${tck.tests.xml}"
overwrite="true"
/>
<xmltask preserveType="true" source="${project.dir}/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.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}/tck/ignoredTestCases.xml -Dtest.non.exclusive.file=${project.dir}/tck/nonExclusiveTestCases.xml"
/>
<execute dir="${tck.home}" failonerror="false">
mvn -Pliferay,run-tck -Djava.awt.headless=true ${tck.properties} -Dtest.browser=htmlunit -Dtest.browser.binary= -Dtest.browser.webDriver= -Dtest.list.file=${project.dir}/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}/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/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[${tck.browser.version}]"
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="false">
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}/tck/${selenium.executable.dir.name}${tck.selenium.browser.driver.executable} -Dtest.list.file=${tck.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}/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/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>
<target name="cleanup-tck">
<exec dir="${tck.home}/.." executable="git" failonerror="false">
<arg value="apply" />
<arg value="--reverse" />
<arg value="${project.dir}/tck/pluto-patch.diff" />
</exec>
</target>
</project>