forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-test-tck.xml
More file actions
164 lines (129 loc) · 5.75 KB
/
Copy pathbuild-test-tck.xml
File metadata and controls
164 lines (129 loc) · 5.75 KB
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
<?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" />
<macrodef name="prepare-chrome-driver">
<sequential>
<property name="tck.chrome.driver.zip" value="chromedriver_linux64.zip" />
<property name="tck.chrome.driver.version" value="100.0.4896.60" />
<mirrors-get
dest="tools/selenium/${tck.chrome.driver.zip}"
src="https://chromedriver.storage.googleapis.com/${tck.chrome.driver.version}/${tck.chrome.driver.zip}"
/>
<stop-chrome-driver />
<unzip
dest="tools/selenium"
src="tools/selenium/${tck.chrome.driver.zip}"
/>
<if>
<os family="unix" />
<then>
<chmod
file="tools/selenium/chromedriver"
perm="a+x"
/>
</then>
</if>
</sequential>
</macrodef>
<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=
enterprise.product.notification.enabled=false
module.framework.auto.deploy.interval=2000
passwords.default.policy.change.required=false
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>
<echo file="${liferay.home}/osgi/configs/com.liferay.frontend.js.spa.web.internal.configuration.SPAConfiguration.config" force="true">enabled=b"false"</echo>
<exec dir="${tck.home}/.." executable="mvn" failonerror="true">
<arg value="-Dmaven.javadoc.skip=true" />
<arg value="-P" />
<arg value="all,liferay" />
<arg value="clean" />
<arg value="install" />
</exec>
<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/generated-resources/xml/final/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">
<var name="tck.login.url" value="http://localhost:8080/group/portlet-tck?SM_USER=test@liferay.com" />
<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}" />
<if>
<isset property="env.JENKINS_HOME" />
<then>
<stop-docker-browser />
<start-docker-browser />
<get-browser-property property.name="browser.host" />
<var name="chrome.properties" value="-Dtest.browser.webDriver.url=http://${browser.host}:4444" />
</then>
<else>
<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" />
<var name="chrome.properties" value="-Dtest.browser.binary=${tck.browser.bin.file} -Dtest.browser.webDriver=${project.dir}/tools/tck/../selenium/chromedriver" />
</else>
</if>
<exec dir="${tck.home}" executable="mvn" failonerror="false">
<arg line="-Pliferay,run-tck -Djava.awt.headless=true ${tck.properties} -Dtest.browser=${browser.type[tck]} ${chrome.properties} -Dtest.list.file=${tck.home}/driver/target/classes/generated-resources/xml/final/test.xml -Dtest.server.login.url=${tck.login.url} test" />
</exec>
<if>
<available file="${tck.home}/driver/target/surefire-reports/TEST-jakarta.portlet.tck.driver.TCKLiferayTestDriver.xml" />
<then>
<mkdir dir="${project.dir}/tools/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-jakarta.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/tools/tck/test-results/TEST-jakarta.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>