forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test-batch.xml
171 lines (141 loc) · 4.61 KB
/
build-test-batch.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
<?xml version="1.0"?>
<project name="portal-test-batch" basedir="." xmlns:antelope="antlib:ise.antelope.tasks" xmlns:if="ant:if" xmlns:unless="ant:unless">
<import file="build-test.xml" />
<condition else="0" property="jenkins.axis.variable" value="${env.AXIS_VARIABLE}">
<isset property="env.AXIS_VARIABLE" />
</condition>
<macrodef name="check-deprecated-method">
<sequential>
<if>
<and>
<available file="javac.output.txt" />
<isset property="env.TOP_LEVEL_SHARED_DIR" />
</and>
<then>
<copy file="javac.output.txt" tofile="${env.TOP_LEVEL_SHARED_DIR}/javac.output.txt" />
</then>
</if>
</sequential>
</macrodef>
<macrodef name="merge-test-results">
<sequential>
<antcall target="merge-test-results" />
<if>
<isset property="env.WORKSPACE" />
<then>
<mkdir dir="${env.WORKSPACE}/test-results" />
<copy file="test-results/TESTS-TestSuites.xml" tofile="${env.WORKSPACE}/test-results/TESTS-TestSuites.xml" />
</then>
</if>
</sequential>
</macrodef>
<macrodef name="prepare-test-build">
<sequential>
<antcall target="prepare-test-build">
<param name="test.class.groups.size" value="${test.batch.size}" />
</antcall>
</sequential>
</macrodef>
<macrodef name="run-batch-test">
<attribute name="test.class.group.index" />
<element name="test-action" />
<sequential>
<if>
<not>
<equals arg1="@{test.class.group.index}" arg2="default" />
</not>
<then>
<prepare-test-build />
<test-action />
<merge-test-results />
<check-deprecated-method />
<if>
<available file=".testable.portal.started" />
<then>
<antcall target="stop-app-server" />
<delete file=".testable.portal.started" failonerror="false" />
</then>
</if>
<print-gc-logs />
</then>
</if>
</sequential>
</macrodef>
<macrodef name="run-build-selenium">
<sequential>
<ant antfile="build.xml" dir="portal-web" target="build-selenium" />
</sequential>
</macrodef>
<macrodef name="run-source-formatter">
<sequential>
<antcall target="test-package" inheritAll="false">
<param name="test.package" value="com.liferay.source.formatter" />
</antcall>
</sequential>
</macrodef>
<target name="integration-mysql">
<run-batch-test test.class.group.index="${jenkins.axis.variable}">
<test-action>
<antcall target="test-class-group">
<param name="test.class.group.index" value="@{test.class.group.index}" />
</antcall>
</test-action>
</run-batch-test>
</target>
<target name="integration-oracle">
<echo>${jenkins.axis.variable}</echo>
</target>
<target name="integration-postgresql">
<echo>${jenkins.axis.variable}</echo>
</target>
<target name="plugins">
<run-batch-test test.class.group.index="${jenkins.axis.variable}">
<test-action>
<ant antfile="build-test-plugins.xml" target="test-plugin-group">
<property name="test.plugin.group.index" value="@{test.class.group.index}" />
</ant>
</test-action>
</run-batch-test>
</target>
<target name="portal-web">
<run-batch-test test.class.group.index="${jenkins.axis.variable}">
<test-action>
<run-build-selenium />
<run-source-formatter />
</test-action>
</run-batch-test>
</target>
<target name="tck">
<run-batch-test test.class.group.index="${jenkins.axis.variable}">
<test-action>
<exec executable="service" failonerror="true">
<arg line="${database.mysql.service.name} start" />
</exec>
<antcall target="rebuild-database" inheritAll="false" />
<antcall target="delete-liferay-home" />
<ant antfile="build-test-tck.xml" target="record-test-tck-package-names">
<property name="test.class.groups.size" value="${test.batch.size}" />
</ant>
<ant antfile="build-test-tck.xml" target="test-class-group">
<property name="test.class.group.index" value="@{test.class.group.index}" />
</ant>
</test-action>
</run-batch-test>
</target>
<target name="unit">
<run-batch-test test.class.group.index="${jenkins.axis.variable}">
<test-action>
<ant dir="portal-service" target="test-class-group" inheritAll="false">
<property name="test.class.group.index" value="@{test.class.group.index}" />
</ant>
<ant dir="portal-impl" target="test-class-group" inheritAll="false">
<property name="test.class.group.index" value="@{test.class.group.index}" />
<property name="test.type" value="unit" />
</ant>
<ant dir="util-java" target="test-class-group" inheritAll="false">
<property name="test.class.group.index" value="@{test.class.group.index}" />
</ant>
</test-action>
</run-batch-test>
</target>
</project>