-
Notifications
You must be signed in to change notification settings - Fork 1
/
runTests2.xml
899 lines (807 loc) · 32 KB
/
runTests2.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
<project
name="runTests2"
default="runTests2"
basedir=".">
<target
name="init"
depends="initWorkspace, initDownloadHosts, initBuildId, initBuildType, initBasicDirectories, initStreamSpecificVariables, initTargetPlatform, initPlatformSpecificProperties, initCurrentUpdateSite,setJavaMajorVersion"
unless="runTest2Initialized">
<property
name="EOL"
value="${line.separator}" />
<property
name="selectiveVerbose"
value="false" />
<!--
If not explicitly passed in from caller, assume 'all'. This is the
default target already, in global test.xml, but this allows us to be explicit
(and, make sure it continues working).
-->
<condition
property="testSuite"
value="${env.testSuite}"
else="all">
<isset property="env.testSuite" />
</condition>
<property
name="buildURL"
value="https://${DOWNLOAD_HOST}/eclipse/downloads/${dropsDirSegment}/${buildId}" />
<!-- if 'baselinePerf' is specified, need to it for "buildId", plus adjust
URL to it, not what we just built. Only "tests" always get buildURL -->
<condition
property="buildIdToUse"
value="${baselinePerfVersionLabel}"
else="${buildId}">
<istrue value="${baselinePerf}" />
</condition>
<condition
property="repoBuildIdToUse"
value="${baselinePerfBuildId}"
else="${buildId}">
<istrue value="${baselinePerf}" />
</condition>
<condition
property="archiveLocation"
value="${baselinePerfLocation}"
else="${buildURL}">
<istrue value="${baselinePerf}" />
</condition>
<!-- TODO: Do we need "buildID" coded somewhere, to know WHICH build to
match with? Or, else will take large number of "baselines" averaged? -->
<condition
property="eclipse.perf.config"
value="build=${baselinePerfVersion}-${buildIdTimestamp};config=${testedPlatformConfig};jvm=${javaMajorVersion}"
else="build=${buildId};config=${testedPlatformConfig};jvm=${javaMajorVersion}">
<istrue value="${baselinePerf}" />
</condition>
<!-- This "assert" property works, in this context, because we run baseline
first, when buildIdToUse != buildId that is a "baseline run" (so, no "assert"
for that baseline run). But, when buildIdToUse == buildId that is a "normal
run" so then we do want to "assert" against the already-collected baseline
data. Note: Note, docs say order does not matter, and could specify "just
build" and reset filled in with what's in 'config', but some experiences
makes me doubt that? TODO: design problem: how to distinguish assert against
baseline vs. baseline alt. -->
<condition
property="eclipse.perf.assertAgainst"
value="build=${baselinePerfVersion}-${buildIdTimestamp};config=${testedPlatformConfig};jvm=${javaMajorVersion};">
<equals
arg1="${buildIdToUse}"
arg2="${buildId}" />
</condition>
<!-- frameworkperfargs is used by library.xml ... probably an easier way? -->
<condition
property="frameworkperfargs"
value="-DInternalWriteRawPerformanceData=${eclipse.perf.samples.out} -Declipse.perf.config=${eclipse.perf.config} -Declipse.perf.assertAgainst=${eclipse.perf.assertAgainst}"
else="-DInternalWriteRawPerformanceData=${eclipse.perf.samples.out} -Declipse.perf.config=${eclipse.perf.config}">
<isset property="eclipse.perf.assertAgainst" />
</condition>
<echo message="setRuntimeArchive os ${os} ws ${ws} arch ${arch}" />
<echo message="build id of runtimeArchive ${buildIdToUse}" />
<echo message="Variables in 'runTests2.xml'" />
<echo message="DOWNLOAD_HOST: ${DOWNLOAD_HOST}" />
<echo message="WORKSPACE: ${WORKSPACE}" />
<echo message="buildId: ${buildId}" />
<echo message="buildIdToUse: ${buildIdToUse}" />
<echo message="relengBaseBuilderDir: ${relengBaseBuilderDir}" />
<echo message="configurationDir: ${configurationDir}" />
<echo message="java.home: ${java.home}" />
<echo message="eclipseStream: ${eclipseStream}" />
<echo message="eclipseStreamMajor: ${eclipseStreamMajor}" />
<echo message="eclipseStreamMinor: ${eclipseStreamMinor}" />
<echo message="buildType: ${buildType}" />
<echo message="testSuite: ${testSuite}" />
<!-- there's nothing "automatic" about the local cache (so far). If specified
(such as on Hudson command line that executes this file, as, say, -DlocalCache=file:///shared/eclipse/localCache
then all the downloads required must be already available there. It is intended
to speed up local testing to avoid re-downloading files. -->
<!-- currently, following is dead code. Leaving for now as a reminder to
allow localCache again, someday -->
<condition
property="archiveLocation"
value="${localCache}"
else="${buildURL}">
<isset property="localCache" />
</condition>
<echo message="buildURL ${buildURL}" />
<echo message="archiveLocation ${archiveLocation}" />
<property
name="runTest2Initialized"
value="true" />
</target>
<target
name="getPlatformIndependentZips"
depends="init"
unless="skipInstall">
<get
retries="5"
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-Automated-Tests-${buildIdToUse}.zip"
dest="${testDir}/eclipse-Automated-Tests-${buildIdToUse}.zip" />
</target>
<target
name="getwinzips"
depends="init, getPlatformIndependentZips"
unless="skipInstall">
<get
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-SDK-${buildIdToUse}-win32-${osgi.arch}.zip"
dest="${executionDir}/eclipse-SDK-${buildIdToUse}-win32-${osgi.arch}.zip" />
<get
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-platform-${buildIdToUse}-win32-${osgi.arch}.zip"
dest="${executionDir}/eclipse-platform-${buildIdToUse}-win32-${osgi.arch}.zip" />
<get
verbose="${selectiveVerbose}"
src="${previousReleaseLocation}/eclipse-platform-${previousReleaseVersion}-win32-${osgi.arch}.zip"
dest="${platformLocation}/eclipse-platform-${previousReleaseVersion}-win32-${osgi.arch}.zip" />
</target>
<target
name="getlinzips"
depends="init, getPlatformIndependentZips"
unless="skipInstall">
<get
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-SDK-${buildIdToUse}-linux-gtk-${osgi.arch}.tar.gz"
dest="${executionDir}/eclipse-SDK-${buildIdToUse}-linux-gtk-${osgi.arch}.tar.gz" />
<get
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-platform-${buildIdToUse}-linux-gtk-${osgi.arch}.tar.gz"
dest="${executionDir}/eclipse-platform-${buildIdToUse}-linux-gtk-${osgi.arch}.tar.gz" />
<get
verbose="${selectiveVerbose}"
src="${previousReleaseLocation}/eclipse-platform-${previousReleaseVersion}-linux-gtk-${osgi.arch}.tar.gz"
dest="${platformLocation}/eclipse-platform-${previousReleaseVersion}-linux-gtk-${osgi.arch}.tar.gz" />
</target>
<target
name="getmacosx"
depends="init, getPlatformIndependentZips"
unless="skipInstall">
<get
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-SDK-${buildIdToUse}-macosx-cocoa-${osgi.arch}.dmg"
dest="${executionDir}/eclipse-SDK-${buildIdToUse}-macosx-cocoa-${osgi.arch}.dmg" />
<get
verbose="${selectiveVerbose}"
src="${archiveLocation}/eclipse-platform-${buildIdToUse}-macosx-cocoa-${osgi.arch}.dmg"
dest="${executionDir}/eclipse-platform-${buildIdToUse}-macosx-cocoa-${osgi.arch}.dmg" />
<get
verbose="${selectiveVerbose}"
src="${previousReleaseLocation}/eclipse-platform-${previousReleaseVersion}-macosx-cocoa-${osgi.arch}.dmg"
dest="${platformLocation}/eclipse-platform-${previousReleaseVersion}-macosx-cocoa-${osgi.arch}.dmg" />
</target>
<target
name="initTargetPlatform"
unless="testPlatform">
<condition
property="testPlatform"
value="windows">
<and>
<equals
arg1="${osgi.os}"
arg2="win32" />
<equals
arg1="${osgi.ws}"
arg2="win32" />
</and>
</condition>
<condition
property="testPlatform"
value="linux">
<and>
<equals
arg1="${osgi.os}"
arg2="linux" />
<equals
arg1="${osgi.ws}"
arg2="gtk" />
</and>
</condition>
<condition
property="testPlatform"
value="macosx">
<and>
<equals
arg1="${osgi.os}"
arg2="macosx" />
<equals
arg1="${osgi.ws}"
arg2="cocoa" />
</and>
</condition>
<echo message="[DEBUG] in runTest2.xml: os ws arch ${osgi.os} ${osgi.ws} ${osgi.arch}" />
<echo message="[INFO] in runTest2.xml: testPlatform ${testPlatform}" />
</target>
<!-- Note that in getting the target platform, we nearly always get the
'buildId' version, the one we just built. But, in some cases, we use "baselinePerf"
version for performance regression testing. In that case, we still get the
"buildId" version of tests ... the ones we just built ... only what we run
them on changes. When we do use 'baselinePerf', that is specified as 'true'
in Hudson job, which signals to use the baselinePerf version defined in 'streamSpecific.properties. -->
<target
name="downloadTargetPlatform"
depends="init">
<!-- TODO: should add checks for checksum integrity on downloads. Perhaps
use mirror URLs? (though, that'd not effect production) -->
<fail
unless="testPlatform"
message="testPlatform did not match any of the supported combinations of osgi.os, osgi.ws" />
<condition
property="getArtifacts"
value="getwinzips">
<equals
arg1="${testPlatform}"
arg2="windows" />
</condition>
<condition
property="getArtifacts"
value="getlinzips">
<equals
arg1="${testPlatform}"
arg2="linux" />
</condition>
<condition
property="getArtifacts"
value="getmacosx">
<equals
arg1="${testPlatform}"
arg2="macosx" />
</condition>
<echo message="getArtifacts ${getArtifacts}" />
<antcall target="${getArtifacts}" />
</target>
<target name="initConfigurationDir">
<property
name="configurationDir"
value="${WORKSPACE}/eclipse.platform.releng.aggregator/production/testScripts/configuration" />
</target>
<target
name="initPlatformSpecificProperties"
depends="initTargetPlatform, initConfigurationDir"
unless="platformSpecificPropertiesInitialized">
<property
name="platformSpecificProperties"
value="${configurationDir}/sdk.tests/testConfigs/${testPlatform}/platformSpecific.properties" />
<loadproperties>
<file file="${platformSpecificProperties}" />
</loadproperties>
<property
name="platformSpecificPropertiesInitialized"
value="true" />
</target>
<target
name="runTests2"
depends="init, initConfigurationDir, downloadTargetPlatform">
<copy
todir="${executionDir}"
verbose="true">
<fileset dir="${configurationDir}/sdk.tests/testConfigs/${testPlatform}" />
</copy>
<copy
verbose="true"
todir="${executionDir}"
overwrite="true">
<fileset dir="${configurationDir}/sdk.tests/testScripts" />
</copy>
<echoproperties
description="Echo all properties in runTest2 after all is initialized, shortly before tests are ran."
destfile="${WORKSPACE}/propertiesAllFromRunTest2.properties" />
<!-- TODO: seems this unzip could/should be moved to test.xml? To do once
only, of course, if not already done. We (sort of) do in test.xml. See its
setupRepo task. -->
<property
name="repoZip"
value="${executionDir}/eclipse-junit-tests-${repoBuildIdToUse}.zip" />
<echo message="repoZip: ${repoZip}" />
<antcall target="unzipTestFramework" />
<!-- We print these properties to a file primarily to capture variables
that might have been set in Hudson, which do not "survive" going through
the bat or script files. ... Though, makes me wonder if we really need to
do that? Seems we could call test.xml directly? In principle, we could call
printProperty from anywhere, but seems best to centralize the function. -->
<antcall target="printProductionProperties" />
<echo message="DEBUG ant.version: ${ant.version}" />
<!-- following are all required by "runtests" ... used to be part of it,
but wanted these variables to print out, even if merely testing scripts,
but not actually running tests. -->
<condition
property="executionArguments"
value="/c ${testScript}">
<and>
<os family="windows" />
</and>
</condition>
<property
name="executionArguments"
value="${testScript}" />
<echo message="=== properties in runTests2, for runTests executable:" />
<echo message=" = properties used in exec task:" />
<echo message=" executionDir ${executionDir}" />
<echo message=" testExecutable ${testExecutable}" />
<echo message=" testScript ${testScript}" />
<echo message=" executionArguments ${executionArguments}" />
<echo message=" = properties set as env variables:" />
<echo message=" propertiesFile: ${WORKSPACE}/production.properties" />
<echo message=" jvm: ${jvm}" />
<echo message=" testedPlatform: ${testedPlatform}" />
<echo message=" testedPlatformConfig: ${testedPlatformConfig}" />
<antcall target="runtests" />
</target>
<target
name="printProductionProperties"
depends="init">
<!-- here we want to print properties, such as passed in via Hudson, that
can be used later, by test.xml, but since it is started by as separate processes,
there is no direct access to Hudson properties ... so we make them persistent.
In many cases, the property will not be defined, in which case we do not
want to write anything for that property (or, it will appear to have been
set, even if set to an empty string). -->
<printProperty property="buildId" />
<printProperty property="buildIdToUse" />
<printProperty property="buildType" />
<printProperty property="eclipseStream" />
<printProperty property="previousReleaseVersion" />
<printProperty property="previousReleaseVersionRepo" />
<printProperty property="baselinePerf" />
<printProperty property="osgi.os" />
<printProperty property="osgi.ws" />
<printProperty property="osgi.arch" />
<printProperty property="DOWNLOAD_HOST" />
<printProperty property="ARCHIVE_HOST" />
<printProperty property="executionDir" />
<printProperty property="install" />
<printProperty property="eclipse-home" />
<printProperty property="isMacAppLayout" />
<printProperty property="configurationDir" />
<printProperty property="org.eclipse.core.net.prefs" />
<printProperty property="testSuite" />
<printProperty property="test.target" />
<printProperty property="testExecutable" />
<printProperty property="testScript" />
<printProperty property="jvm" />
<printProperty property="java.version" />
<printProperty property="javaMajorVersion" />
<printProperty property="testedPlatform" />
<printProperty property="testedPlatformConfig" />
<printProperty property="eclipse.perf.samples.out" />
<printProperty property="eclipse.perf.dbloc" />
<printProperty property="eclipse.perf.config" />
<printProperty property="eclipse.perf.assertAgainst" />
<printProperty property="currentUpdateSite" />
</target>
<target
name="initStreamSpecificProperties"
depends="initConfigurationDir"
unless="streamSpecificPropertiesSet">
<property file="${configurationDir}/streamSpecific.properties" />
<property
name="streamSpecificPropertiesSet"
value="true" />
</target>
<target
name="initCurrentUpdateSite"
depends="initDownloadHosts, initStreamVariables, initBuildId, initBuildType"
unless="currentUpdateSite">
<property
name="currentUpdateSite"
value="https://${DOWNLOAD_HOST}/eclipse/updates/${updateSiteSegment}-${buildType}-builds/${buildId}" />
</target>
<target
name="checkInstallDir"
if="install">
<echo message="[DEBUG] in test.xml: Found the value of install already set, to ${install}" />
</target>
<target
name="initInstallDir"
depends="initBuildId, initStreamSpecificProperties, checkInstallDir"
unless="install">
<property
name="testDir"
value="${WORKSPACE}/workarea/${buildId}" />
<echo message="[DEBUG] in runTests2.xml: testDir: ${testDir}" />
<property
name="executionDir"
value="${testDir}/eclipse-testing" />
<mkdir dir="${executionDir}" />
<echo message="[DEBUG] in runTests2.xml: executionDir: ${executionDir}" />
<!--default directory where test-eclipse-sdk will be installed -->
<property
name="install"
value="${executionDir}/test-eclipse" />
<mkdir dir="${install}" />
<echo message="[DEBUG] in runTests2.xml: the value of install was set to: ${install}" />
</target>
<!-- eclipse-home set to be the folder that will later contain the plugins
folder. Note: we have to set eclipse-home, rather than use "eclpse.home"
or "eclipse.home.location" because at this point we are executing from the
"setup" version of eclipse (aka basebuilder) not the actual version of eclipse
we will later be testing. -->
<target
name="initEclipseHome"
depends="initStreamSpecificProperties, initInstallDir, checkEclipseHome"
unless="eclipse-home">
<condition
property="eclipse-home"
value="${install}/Eclipse.app/Contents/Eclipse"
else="${install}/eclipse">
<and>
<os family="mac" />
<istrue value="${isMacAppLayout}" />
</and>
</condition>
<echo message="[DEBUG] in runTest2.xml the value of eclipse-home was set to: ${eclipse-home}" />
</target>
<!-- Intended to be called only from initEclipseHome, simply as extra information
for debugging -->
<target
name="checkEclipseHome"
if="eclipse-home">
<echo message="[DEBUG] Found the value of eclipse-home already set, to ${eclipse-home}" />
</target>
<macrodef name="printProperty">
<!-- the use of properyfile and local require at least Ant 1.8 -->
<attribute name="property" />
<sequential>
<echo message="DEBUG @{property}: ${@{property}}" />
<!-- for our use, 'del' operation won't typically delete anything, since
would not have been there to begin with, but is an easy way to prevent an
undefined property from being written -->
<local name="oper" />
<condition
property="oper"
value="="
else="del">
<isset property="@{property}" />
</condition>
<propertyfile file="${WORKSPACE}/production.properties">
<entry
key="@{property}"
value="${@{property}}"
operation="${oper}" />
</propertyfile>
</sequential>
</macrodef>
<!-- This initStreamSpecificVariables target was copied from buildAll.xml
and does about exactly the same thing, purposely left close to original,
though not as much is actually required. TODO: in future, pull out into one
file, and reuse You can tell from comment, it is out dated. Its purpose,
here, is entirely to pick up "stream specific" stings from the releng maps
project, 'configuration' folder. Important note: here, unlike the one in
buildAll.xml, we assume the maps have already been checked out, say by Hudson,
as a peer of eclipseBuilder, rather then us doing the checkout here, ourselves.
Not sure which is easier, but current means Hudson job has to be set up with
two git checkout steps, right version for maps (for 3.8 vs 4.2). -->
<target
name="initStreamSpecificVariables"
unless="initStreamSpecificVariablesComplete"
depends="initWorkspace,initBuildType,initConfigurationDir,initStreamVariables,initDownloadHosts">
<echo message="DEBUG: executing initStreamSpecificVariables" />
<!-- these conditions used to be in "init". Conceptually seems right to
be in "stream specific" init (since their value depends on stream) but may
have side effects?). This is really no longer relevant, as everything we
build/tests comes from "drops4" ... but will leave in case we ever have a
"drops5" ... or, have to back port tests to re-test 3.8! (Which, we probably
do, for 3.8?) -->
<condition
property="dropsDirSegment"
value="drops4"
else="drops">
<equals
arg1="${eclipseStreamMajor}"
arg2="4" />
</condition>
<loadproperties srcFile="${configurationDir}/streamSpecific.properties" />
<!-- echo a few typically expected properties, to make sure getting right
file -->
<echo message="streamSpecificPropertiesTitle: ${streamSpecificPropertiesTitle}" />
<echo message="previousReleaseLocation: ${previousReleaseLocation}" />
<echo message="previousReleaseVersion: ${previousReleaseVersion}" />
<echo message="previousReleaseVersionRepo: ${previousReleaseVersionRepo}" />
<property
name="initStreamSpecificVariablesComplete"
value="true" />
</target>
<!-- DOWNLOAD_HOST and ARCHIVE_HOST can be defined on command line, if running
on local test environments. -->
<target
name="initDownloadHosts"
unless="DOWNLOAD_HOST">
<!-- we assume if "DOWNLOAD_HOST" is defined, then ARCHIVE_HOST has been
defined also. -->
<property environment="env" />
<echo message="DEBUG: Found DOWNLOAD_HOST not defined. Setting in 'initDownloadHosts'" />
<echo message="DEBUG: env.DOWNLOAD_HOST: ${env.DOWNLOAD_HOST}" />
<condition
property="DOWNLOAD_HOST"
value="${env.DOWNLOAD_HOST}"
else="download.eclipse.org">
<isset property="env.DOWNLOAD_HOST" />
</condition>
<condition
property="ARCHIVE_HOST"
value="${env.ARCHIVE_HOST}"
else="archive.eclipse.org">
<isset property="env.ARCHIVE_HOST" />
</condition>
</target>
<target
name="initWorkspace"
unless="WORKSPACE">
<property environment="env" />
<condition
property="WORKSPACE"
value="${env.WORKSPACE}"
else="${basedir}">
<isset property="env.WORKSPACE" />
</condition>
</target>
<target
name="initBuildId"
unless="buildId">
<!--property file that can contain the buildId, if not otherwise set -->
<property file="label.properties" />
<fail
unless="buildId"
message="buildId (e.g I20140731-0800) needs to be provided to run the tests" />
</target>
<target name="initBuildType">
<fail
unless="buildId"
message="buildId value must be provided by caller (such as 'I20120717-0800'" />
<!-- this "buildId check" may be overly strict, but best to start off strict
for now, loosen in future if we start to find/have variety -->
<condition property="buildIdOK">
<matches
pattern="^[IMXYNPSRU]\d{8}-\d{4}$"
string="${buildId}" />
</condition>
<fail
message="buildId variable had unexpected format. Should be of the form [IMXYNPSRU] 8 digits '-' 4 digits, but was ${buildId}"
unless="buildIdOK" />
<loadresource property="buildType">
<string value="${buildId}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="^([IMXYNPSRU])(\d{8})-(\d{4})$" replace="\1"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="buildType: ${buildType}"/>
<loadresource property="buildIdTimestamp">
<string value="${buildId}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="^([IMXYNPSRU])(\d{8})-(\d{4})$" replace="\2\3"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="buildIdTimestamp: ${buildIdTimestamp}"/>
<fail unless="buildType" />
</target>
<!-- main purpose of initStreamVariables, it to be sure we have eclipseStreamMajor
and eclipseStreamMinor Uses script, which requires Java 1.6 (or ... else
gets complicated to setup) -->
<target
name="initStreamVariables"
depends="initConfigurationDir"
unless="streamVariablesInitialized">
<property file="${configurationDir}/streamSpecific.properties" />
<fail
unless="eclipseStream"
message="eclipseStream value must be provided by caller, such as '4.3' or '4.4.2." />
<condition property="streamOK">
<matches
pattern="\d\.\d(\.\d)?"
string="${eclipseStream}" />
</condition>
<fail
message="eclipseStream variable had unexpected format. Should be of form digit.digit[.digit], but was ${eclipseStream}"
unless="streamOK" />
<loadresource property="eclipseStreamMajor">
<string value="${eclipseStream}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="^(\d+)\.(\d+)(\.(\d+))" replace="\1"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="eclipseStreamMajor: ${eclipseStreamMajor}"/>
<loadresource property="eclipseStreamMinor">
<string value="${eclipseStream}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="^(\d+)\.(\d+)(\.(\d+))" replace="\2"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="eclipseStreamMinor: ${eclipseStreamMinor}"/>
<loadresource property="updateSiteSegment">
<string value="${eclipseStream}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="^(\d+)\.(\d+)(\.(\d+))" replace="\1\.\2"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="updateSiteSegment: ${updateSiteSegment}"/>
<fail
unless="eclipseStreamMajor"
message="eclipseStreamMajor not defined or computable" />
<fail
unless="eclipseStreamMinor"
message="eclipseStreamMinor not defined or computable" />
<fail
unless="updateSiteSegment"
message="updateSiteSegment not defined or computable" />
<property
name="streamVariablesInitialized"
value="true" />
</target>
<target
name="initBasicDirectories"
depends="initWorkspace,initBuildId, initStreamSpecificProperties,initInstallDir, initEclipseHome, initPlatformSpecificProperties, setJavaMajorVersion"
unless="basicDirectoriesInitialized">
<property environment="env" />
<property
name="repoZip"
value="${executionDir}/eclipse-junit-tests-${repoBuildIdToUse}.zip" />
<echo message="repoZip: ${repoZip}" />
<property
name="repoLocation"
value="${executionDir}/testRepo" />
<echo message="repoLocation: ${repoLocation}" />
<property
name="platformLocation"
value="${executionDir}/platformLocation" />
<mkdir dir="${platformLocation}" />
<echo message="platformLocation: ${platformLocation}" />
<property
name="testedPlatformConfig"
value="${osgi.os}.${osgi.ws}.${osgi.arch}" />
<property
name="testedPlatform"
value="${env.JOB_BASE_NAME}_${osgi.os}.${osgi.ws}.${osgi.arch}_${javaMajorVersion}" />
<!-- The directory that will contain all files containing information on
the tests that ran. -->
<property
name="results"
value="${executionDir}/results" />
<mkdir dir="${results}" />
<mkdir dir="${results}/xml" />
<mkdir dir="${results}/html" />
<echo message="results: ${results}" />
<!--Directory for JUnit report output, console log output and .log content
for each test suite. Overrides default in org.eclipse.test/library.xml -->
<property
name="junit-report-output"
value="${results}/${testedPlatform}" />
<mkdir dir="${junit-report-output}" />
<echo message="junit-report-output: ${junit-report-output}" />
<property
name="directorLogs"
value="${results}/${testedPlatform}/directorLogs" />
<mkdir dir="${directorLogs}" />
<echo message="directorLogs: ${directorLogs}" />
<property
name="eclipse.perf.samples.out"
value="${results}/${testedPlatform}-perf-samples.dat" />
<echo message="eclipse.perf.samples.out: ${eclipse.perf.samples.out}" />
<!-- this directory, with some sort files are created during unit tests
... need to find where to disable/enable JaCoCo -->
<property
name="coverage-output"
value="${results}/coverageIGNORE" />
<property
name="basicDirectoriesInitialized"
value="true" />
<echo message="basicDirectoriesInitialized" />
</target>
<!-- This task unzips the test framework that was built. It includes misc.
files, the Test Framework proper, and a zipped up repo of the unit tests.
We also do this in "testAll" scripts ...? TODO: investigate how to avoid
doing there, if already done. -->
<target name="unzipTestFramework">
<fail unless="testDir" />
<fail unless="buildIdToUse" />
<property
name="testResults"
value="${testDir}/testresults" />
<property
name="testFramework"
value="${testDir}/eclipse-Automated-Tests-${buildIdToUse}.zip" />
<condition property="testFrameworkExists">
<available file="${testFramework}" />
</condition>
<fail unless="testFrameworkExists" />
<echo message="testFramework: ${testFramework}" />
<echo message="testDir: ${testDir}" />
<echo message="testResults: ${testResults}" />
<!--set up testing directory -->
<unzip
src="${testFramework}"
dest="${testDir}"
overwrite="false">
<patternset>
<exclude name="**/equinoxp2tests.properties" />
<exclude name="**/test.xml" />
</patternset>
</unzip>
</target>
<target
name="runtests"
depends="init"
unless="env.TESTING_TEST_XML">
<mkdir dir="${executionDir}/results/consolelogs"/>
<chmod file="${executionDir}/${testScript}" perm="755"/>
<!--run the tests -->
<exec
dir="${executionDir}"
executable="${testExecutable}"
output="${executionDir}/results/consolelogs/${testedPlatform}_consolelog.txt">
<arg line="${executionArguments}" />
<arg line="-os ${osgi.os} -ws ${osgi.ws} -arch ${osgi.arch}"/>
<arg value="-vm"/><arg path="${jvm}"/>
<arg value="-properties"/><arg path="${WORKSPACE}/production.properties"/>
<arg value="${testSuite}" />
<env
key="jvm"
file="${jvm}" />
<env
key="testedPlatform"
value="${testedPlatform}" />
</exec>
</target>
<target
name="setJVMProperties"
depends="initPlatformSpecificProperties,setJVMfromUserSpecified"
unless="jvm">
<property
name="VMSource"
value="VM used for tests, is same that invoked Ant: '${java.home}/bin/java' (that is, 'jvm' not specified by caller)." />
<echo message="VMSource: ${VMSource}" />
<condition
property="jvm"
value="${java.home}\bin\java.exe"
else="${java.home}/bin/java">
<equals
arg1="${testPlatform}"
arg2="windows" />
</condition>
<echo message="full output from 'java -version' of ${jvm} is" />
<exec
executable="${jvm}">
<arg line="-version" />
</exec>
</target>
<target
name="setJVMfromUserSpecified"
if="jvm">
<property
name="VMSource"
value="VM used for tests, specified by caller: 'jvm'=${jvm}" />
<echo message="VMSource: ${VMSource}" />
<echo message="full output from 'java -version' of ${jvm} is" />
<exec
executable="${jvm}">
<arg line="-version" />
</exec>
</target>
<!-- function to centralize how we get (that is, set) the value of 'javaMajorVersion'.
(expected to be integer, such as 5,6,7,8,9, or will be "0" if the version
could not be determined, for some reason. -->
<target
name="setJavaMajorVersion"
depends="setJVMProperties"
unless="javaMajorVersion">
<echo message="javaversion in setJavaMajorVersion: ${java.version}" />
<loadresource property="javaMajorVersion">
<string value="${java.version}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="(\d+)[\.-].*" replace="\1"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="javaMajorVersion: ${javaMajorVersion}"/>
</target>
</project>