-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathant-test.xml
299 lines (286 loc) · 14.8 KB
/
ant-test.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<?xml version="1.0" encoding="utf-8" ?>
<!--
THESE TARGETS ARE NOT INTENDED FOR DIRECT USE. This file breaks out testing logic from the main 'build.xml file.
Unless you're debugging the Ant scripts themselves, you very likely shoud ignore this file. Automated processes may
call these targets directly in order to optimize processes.
-->
<project name="stories-test" default="smoke-test-full-immediate" basedir=".">
<import file="./ant-common.xml"/>
<property file="./aws-settings.prop"/>
<property file="/mnt/bamboo-ebs/aws-settings.prop"/>
<target name="test.dev" depends="testFunctional.dev-immediate, testI18nEs.dev-immediate, test-worker"/>
<!-- Runs the non-i18n unit tests. -->
<!-- internal target -->
<target name="testFunctional.dev-immediate" depends="loadTestDb">
<mkdir dir="reports/htmlunit.dev"/>
<junit fork="yes" printsummary="yes" haltonfailure="no">
<jvmarg line="-Xmx512m"/>
<sysproperty key="gwt.args" value="-logLevel WARN"/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="org.consumersunion.testMode" value="true"/>
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<sysproperty key="org.consumersunion.constraintConnectionPool" value="true"/>
<!-- Used to distinguish amazon service URL / names -->
<sysproperty key="PARAM1" value="${PARAM1}"/>
<sysproperty key="PARAM2" value="${PARAM2}"/>
<sysproperty key="aws.accessKeyId" value="${AWS_TEST_ACCESS_KEY}"/>
<sysproperty key="aws.secretKey" value="${AWS_TEST_SECRET_KEY}"/>
<sysproperty key="SMTP_FROM" value="${SMTP_FROM}"/>
<sysproperty key="sys.noS3" value="TRUE"/>
<classpath>
<pathelement location="dashboard/target/classes"/>
<pathelement location="dashboard/target/test-classes"/>
<path refid="dashboard.gwt.tests"/>
<path refid="test.classpath"/>
</classpath>
<batchtest todir="reports/htmlunit.dev">
<fileset dir="dashboard/src/test/java">
<include name="**/*Test.java"/>
<include name="**/*TestSuite.java"/>
<!-- exclude all the GWT test cases; they are run in suites in order to improve efficiency -->
<exclude name="**/ui/widget/**/*.java"/>
<exclude name="**/service/client/**/*.java"/>
<exclude name="**/*GwtTest.java"/>
<!-- exclude the i18n tests; these are run seperately for each locale -->
<exclude name="**/I18n*Test.java"/>
<exclude name="**/server/api/*Test.java"/>
</fileset>
</batchtest>
<formatter type="plain"/>
<formatter type="xml"/>
</junit>
</target>
<!-- internal target -->
<target name="testI18nEs.dev-immediate" depends="loadTestDb">
<mkdir dir="reports/htmlunit.dev"/>
<junit fork="yes" printsummary="yes" haltonfailure="no">
<jvmarg line="-Xmx512m"/>
<sysproperty key="gwt.args" value="-logLevel WARN"/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="org.consumersunion.testMode" value="true"/>
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<sysproperty key="org.consumersunion.constraintConnectionPool" value="true"/>
<!-- Used to distinguish amazon service URL / names -->
<sysproperty key="PARAM1" value="${PARAM1}"/>
<sysproperty key="PARAM2" value="${PARAM2}"/>
<sysproperty key="aws.accessKeyId" value="${AWS_TEST_ACCESS_KEY}"/>
<sysproperty key="aws.secretKey" value="${AWS_TEST_SECRET_KEY}"/>
<sysproperty key="SMTP_FROM" value="${SMTP_FROM}"/>
<classpath>
<pathelement location="dashboard/target/classes"/>
<pathelement location="dashboard/target/test-classes"/>
<path refid="dashboard.gwt.tests"/>
<path refid="test.classpath"/>
</classpath>
<batchtest todir="reports/htmlunit.dev">
<fileset dir="dashboard/src/test/java">
<include name="**/I18n*Test.java"/>
</fileset>
</batchtest>
<formatter type="plain"/>
<formatter type="xml"/>
</junit>
</target>
<!-- Runs the unit tests in production mode. Notice this does not separate the i18n and non-i18n tests as the dev
mode tests do. This has an external dependency on javac.tests from the build.xml which it expects to have
already been run. -->
<!-- internal target -->
<target name="test.prod-immediate" depends="loadTestDb">
<mkdir dir="reports/htmlunit.prod"/>
<junit fork="yes" printsummary="yes" haltonfailure="no">
<jvmarg line="-Xmx512m"/>
<sysproperty key="gwt.args" value="-logLevel WARN"/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="org.consumersunion.testMode" value="true"/>
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<sysproperty key="org.consumersunion.constraintConnectionPool" value="true"/>
<!-- Used to distinguish amazon service URL / names -->
<sysproperty key="PARAM1" value="${PARAM1}"/>
<sysproperty key="PARAM2" value="${PARAM2}"/>
<sysproperty key="aws.accessKeyId" value="${AWS_TEST_ACCESS_KEY}"/>
<sysproperty key="aws.secretKey" value="${AWS_TEST_SECRET_KEY}"/>
<sysproperty key="SMTP_FROM" value="${SMTP_FROM}"/>
<classpath>
<pathelement location="dashboard/target/classes"/>
<pathelement location="dashboard/target/test-classes"/>
<path refid="dashboard.gwt.tests"/>
<path refid="test.classpath"/>
</classpath>
<batchtest todir="reports/htmlunit.prod">
<fileset dir="dashboard/src/test/java">
<include name="**/*Test.java"/>
<include name="**/*TestSuite.java"/>
<!-- exclude all the GWT test cases; they are run in suites in order to improve efficiency -->
<exclude name="**/ui/widget/**/*.java"/>
<exclude name="**/service/client/**/*.java"/>
<exclude name="**/server/api/*Test.java"/>
<exclude name="**/*GwtTest.java"/>
</fileset>
</batchtest>
<formatter type="plain"/>
<formatter type="xml"/>
</junit>
</target>
<!-- internal target -->
<target name="smoke-test-full-immediate">
<antcall target="testFunctional.dev-immediate" inheritrefs="true"/>
<antcall target="testI18nEs.dev-immediate" inheritrefs="true"/>
<antcall target="test.prod-immediate" inheritrefs="true"/>
<!-- This includes both i18n and non-i18n tests. -->
</target>
<path id="cukes.classpath">
<path refid="compile.classpath"/>
<pathelement location="dashboard/target/classes"/>
<pathelement location="dashboard/target/test-classes"/>
</path>
<!-- Runs the general, non-convio cucumber tests. There is an external dependency on javac.tests, defined in
build.xml which we expect to have been run before invoking this target. -->
<!-- internal target -->
<target name="runcukes-immediate" depends="loadTestDb">
<mkdir dir="reports/cucumber"/>
<java classname="cucumber.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus">
<classpath refid="cukes.classpath"/>
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<sysproperty key="skipDbUpdate" value="true"/>
<!-- No need for the client side VM to mess with the DB -->
<jvmarg value="-DCUKE_URL_BASE=${CUKE_URL_BASE}"/>
<jvmarg value="-DWEBDRVIER_DRIVER_CHROME=test-utils/chromedriver"/>
<arg value="--tags"/>
<arg value="~@broken"/>
<arg value="--format"/>
<arg value="junit:reports/cucumber/cucumber-junit-report.xml"/>
<arg value="--format"/>
<arg value="pretty"/>
<arg value="--format"/>
<arg value="html:treports/cucumber/cucumber-html-report"/>
<arg value="--glue"/>
<arg value="org.consumersunion.stories.cucumber.steps"/>
<arg value="dashboard/src/test/resources/org/consumersunion/stories/cucumber/features/console/"/>
</java>
<fail message="Cucumber failed">
<condition>
<not>
<equals arg1="${cucumber.exitstatus}" arg2="0"/>
</not>
</condition>
</fail>
</target>
<!-- Runs the convio specific acceptance tests. This has an external dependency on javac.tests in build.xml which
we expect to have been invoked before this target is invoked. -->
<!-- internal target -->
<target name="runcukes-convio-immediate">
<mkdir dir="target/cucumber-junit-report"/>
<!-- java classname="cucumber.api.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus" -->
<java classname="cucumber.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus">
<classpath refid="cukes.classpath"/>
<sysproperty key="CUKE_URL_BASE" value="${CUKE_URL_BASE}"/>
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<arg value="--format"/>
<arg value="junit:target/cucumber-junit-report.xml"/>
<arg value="--format"/>
<arg value="pretty"/>
<arg value="--format"/>
<arg value="html:target/cucumber-html-report"/>
<arg value="--glue"/>
<arg value="org.consumersunion.stories.cucumber.steps"/>
<arg value="dashboard/src/test/resources/org/consumersunion/stories/cucumber/features/convio"/>
</java>
<fail message="Cucumber failed">
<condition>
<not>
<equals arg1="${cucumber.exitstatus}" arg2="0"/>
</not>
</condition>
</fail>
</target>
<!-- Sets up the initial test database. This target depends on javac defined in the build.xml having been run
prior to invoking this target. -->
<!-- internal target -->
<target name="condition-debug">
<echo message="${aws.environment}"/>
<echo message="${env.aws.environment}"/>
<echoproperties regex="aws.*"/>
<echoproperties regex="env.*"/>
</target>
<target name="loadTestDb" depends="-test-index-local,-test-index-verify, condition-debug" unless="skipDb"/>
<target name="-test-index-local" depends="-test-sql" unless="env.aws.environment">
<chmod file="tool/reindex.sh" perm="a+x" type="file"/>
<exec executable="tool/reindex.sh" os="Linux" failonerror="true" resultproperty="return.code"/>
</target>
<target name="-test-index-verify" depends="-test-sql" if="env.aws.environment">
<chmod file="tool/reindex.sh" perm="a+x" type="file"/>
<exec executable="tool/reindex.sh" os="Linux" failonerror="true" resultproperty="return.code">
<arg value="verify"/>
</exec>
</target>
<target name="-test-sql" depends="javac.tests-dashboard">
<echo message="JDBC_URL: ${JDBC_URL}"/>
<java failonerror="true" fork="true" classname="org.consumersunion.stories.server.persistence.ScriptRunner">
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<classpath>
<path refid="runtime.classpath"/>
<pathelement location="dashboard/target/classes"/>
</classpath>
<jvmarg value="-Xmx512m"/>
<arg value="sql/stories.sql"/>
</java>
<java failonerror="true" fork="true" classname="org.consumersunion.stories.server.persistence.ScriptRunner">
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<classpath>
<path refid="runtime.classpath"/>
<pathelement location="dashboard/target/classes"/>
</classpath>
<jvmarg value="-Xmx512m"/>
<arg value="sql/create_triggers.sql"/>
</java>
<java failonerror="true" fork="true" classname="org.consumersunion.stories.server.persistence.ScriptRunner">
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<classpath>
<path refid="runtime.classpath"/>
<pathelement location="dashboard/target/classes"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<arg value="sql/testdata.sql"/>
</java>
</target>
<target name="java-index">
<echo message="JDBC_URL: ${JDBC_URL}"/>
<java failonerror="true" fork="true" classname="MainIndexer">
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<classpath>
<path refid="runtime.classpath"/>
<pathelement location="dashboard/target/classes"/>
</classpath>
<jvmarg value="-Xmx512m"/>
</java>
</target>
<target name="test-worker">
<mkdir dir="reports/worker"/>
<junit fork="yes" printsummary="yes" haltonfailure="no">
<jvmarg line="-Xmx512m"/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="org.consumersunion.testMode" value="true"/>
<sysproperty key="JDBC_CONNECTION_STRING" value="${JDBC_URL}"/>
<sysproperty key="org.consumersunion.constraintConnectionPool" value="true"/>
<!-- Used to distinguish amazon service URL / names -->
<sysproperty key="PARAM1" value="${PARAM1}"/>
<sysproperty key="PARAM2" value="${PARAM2}"/>
<sysproperty key="aws.accessKeyId" value="${AWS_TEST_ACCESS_KEY}"/>
<sysproperty key="aws.secretKey" value="${AWS_TEST_SECRET_KEY}"/>
<sysproperty key="SMTP_FROM" value="${SMTP_FROM}"/>
<classpath>
<pathelement location="worker/target/classes"/>
<pathelement location="worker/target/test-classes"/>
<path refid="test.classpath"/>
</classpath>
<batchtest todir="reports/worker">
<fileset dir="worker/src/test/java">
<include name="**/*Test.java"/>
<include name="**/*TestSuite.java"/>
</fileset>
</batchtest>
<formatter type="plain"/>
<formatter type="xml"/>
</junit>
</target>
</project>