Skip to main content
summaryrefslogtreecommitdiffstats
blob: 5d1b27d214e37e4bdada1b98d3e015ced9696202 (plain) (blame)
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
<project
  name="SimRel Tests"
  basedir="."
  default="runReports">

  <!-- define 'env' globally -->
  <property environment="env" />

  <!-- The 'aggrPropertyFile' property file name is itself a property, so it can be overridden
    on one machine versus another. We do it this way, instead of just specifying
    -propertyFile on command line, so that the property values can be "nested"
    in other property values and evaluated lazily. -->
  <property
    name="aggrPropertyFile"
    value="aggr.properties" />
  <echo message="aggrPropertyFile: ${aggrPropertyFile}" />
  <property file="${aggrPropertyFile}" />

  <!-- We'll put test output files right in "the p2 repository". Though, later
       we will want to "save old reports", without saving the entire repository.
       .../reporeports/reports contains the actual reports.
       .../reporeports contains the index.html file.
  -->
  <property
    name="testRepoDirectory"
    value="${BUILD_HOME}/aggregation/final" />

  <property
    name="reportOutputDir"
    value="${testRepoDirectory}/buildInfo" />

  <!-- buildInfo should already exist, and contain "properties" of build -->
  <mkdir dir="${reportOutputDir}" />

  <!-- We should be passed (or, inherit) the release value from where
       this script it called in build.xml.
       TODO: would be best to control this value from Hudson property,
       so that changes in future do not require changes in code.
       NOTE: another example of where "update" and "mainline" would
       be useful variables to have?
  -->
  <!-- reference repository for update releases is alwasy the previous release.
       reference repository for mainline release should be the latest "update staging" repostory,
       once it exists and is accurate.
  -->
  <condition
    property="referenceRepoDir"
    value="/home/data/httpd/download.eclipse.org/releases/photon/201806271001">
    <equals
      arg1="${release}"
      arg2="photon" />
  </condition>
  <condition
    property="referenceRepoDir"
    value="/home/data/httpd/download.eclipse.org/releases/oxygen/201712201001">
    <equals
      arg1="${release}"
      arg2="oxygen" />
  </condition>
  <condition
    property="referenceRepoDir"
    value="/home/data/httpd/download.eclipse.org/releases/neon/201610111000">
    <equals
      arg1="${release}"
      arg2="neon" />
  </condition>
  <echo message="[DEBUG] Computing referenceRepoDir. release: ${release}" />
  <echo message="[DEBUG] Computed referenceRepoDir: ${referenceRepoDir}" />

  <property
    name="eclipseTestExecutable"
    value="${ECLIPSE_EXE}" />

  <!--
     Each "type" of build, ends by calling one of these targets.
     So far, only the "clean build" has any real tests, be eventually others
     could have some checks/tests.
  -->
  <target
    name="validateOnlyTests"
    description="Tests appropriate when only metadata available">
    <echo message="No validation-only tests, yet (other then the aggregation validation itself)." />
  </target>

  <target
    name="cachedBuildTests"
    description="Tests appropriate when metadata and artifacts available (though, for cached build, may be 'extra' artifacts not cleaned up yet">
    <echo message="No cached build tests, yet (other then the cached aggregation build itself)." />
  </target>

  <target
    name="cleanBuildTests"
    description="The primary and final time to test metadata and artifacts."
    depends="runReports">
    <echo>
      Ran standard clean build reports and tests.
      See report in ${reportOutputDir}.
    </echo>
  </target>

  <target name="runReports">
    <echo message="Creating Reports" />
    <property
      name="REPORT_APP_NAME"
      value="org.eclipse.cbi.p2repo.analyzers.repoReport" />
    <property
      name="VM_TEST_ARGS"
      value="-Djava.io.tmpdir=${BUILD_HOME}/tmp -DreportOutputDir=${reportOutputDir} -DreportRepoDir=${testRepoDirectory} -DreferenceRepo=${referenceRepoDir}" />
    <echo message="in runReports: eclipseTestExecutable: ${eclipseTestExecutable}" />
    <echo message="in runReports: REPORT_APP_NAME: ${REPORT_APP_NAME}" />
    <echo message="in runReports: JAVA_HOME: ${JAVA_HOME}" />
    <echo message="in runReports: VM_TEST_ARGS: ${VM_TEST_ARGS}" />
    <echo message="in runReports: reportOutputDir: ${reportOutputDir}" />
    <echo message="in runReports: testRepoDirectory: ${testRepoDirectory}" />
    <echo message="in runReports: referenceRepoDir: ${referenceRepoDir}" />
    <echo message="in runReports: basedir: ${basedir}" />
    <exec
      executable="${eclipseTestExecutable}"
      dir="${basedir}"
      failonerror="false"
      failifexecutionfails="true"
      resultproperty="applicationResult">
      <arg value="-nosplash" />
      <arg value="-debug" />
      <arg value="--launcher.suppressErrors" />
      <arg value="-application" />
      <arg value="${REPORT_APP_NAME}" />
      <arg value="-vmargs" />
      <arg line="${VM_TEST_ARGS}" />
    </exec>

    <echo message="DEBUG: applicationResult: ${applicationResult}" />
    <condition property="failuresoccurred">
      <and>
        <isset property="applicationResult" />
        <not>
          <equals
            arg1="${applicationResult}"
            arg2="0" />
        </not>
      </and>
    </condition>
      <!-- currently, we (should) never "fail" ... but, will in future -->
      <!-- need to learn how to signal "unstable" to Hudson, as opposed to outright failure. -->
    <fail if="failuresoccurred" />
  </target>

</project>

Back to the top