aboutsummaryrefslogtreecommitdiff
path: root/bigtop-tests/test-execution/common/pom.xml
blob: b18266f3d6b95748e7b9249eec295bac25405494 (plain)
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.bigtop</groupId>
    <artifactId>bigtop</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <relativePath>../../../pom.xml</relativePath>
  </parent>

  <groupId>org.apache.bigtop.itest</groupId>
  <artifactId>stacks-common</artifactId>
  <packaging>pom</packaging>
  <version>1.1.0-SNAPSHOT</version>
  <name>stacks-validation-common</name>

  <properties>
    <!--
    Top-level POM file for Hadoop stack testing collects together a number of
    common functionality, dependencies,
    Most of the defaults can be overwritten in sub-modules if so desired.
    -->
    <!--
      Making sure that we have proper variables needed for Hadoop testing
      These settings should be enforced at the top level
    -->
    <HADOOP_HOME>${env.HADOOP_HOME}</HADOOP_HOME>
    <HADOOP_MAPRED_HOME>${env.HADOOP_MAPRED_HOME}</HADOOP_MAPRED_HOME>
    <HADOOP_CONF_DIR>${env.HADOOP_CONF_DIR}</HADOOP_CONF_DIR>
    <!--
      Default exclude mask for failsafe plugin. OPTIONAL
      Default value is set below to represent non-existent name
      If a module needs to exclude certain test patterns this property has to be overwritten
    -->

    <org.apache.maven-failsafe-plugin.testExclude>null</org.apache.maven-failsafe-plugin.testExclude>
    <!--
      Default include mask for failsafe plugin. OPTIONAL
      Default value is set below
      If a module needs to run different set of tests this property has to be overwritten
    -->

    <org.apache.maven-failsafe-plugin.testInclude>**/Test*</org.apache.maven-failsafe-plugin.testInclude>
    <!--
        destination folder where all temp. files will be copied for further processing, REQUIRED
        Should be defined in a sub-module
    -->
    <org.codehaus.groovy.maven.destination>${project.build.testOutputDirectory}</org.codehaus.groovy.maven.destination>
    <!--
        test artifact jar name to be processes e.g. data unpacking, etc, REQUIRED
        Should be defined in a sub-module
    -->
    <org.codehaus.groovy.maven.jar></org.codehaus.groovy.maven.jar>
    <!--
        groupId of test artifact which contains jar files, REQUIRED
        Should be defined in a sub-module
    -->
    <org.apache.maven-dependency-plugin.groupId></org.apache.maven-dependency-plugin.groupId>
    <!--
        artifactId of test artifact which contains jar files, REQUIRED
        Should be defined in a sub-module
    -->
    <org.apache.maven-dependency-plugin.artifactId></org.apache.maven-dependency-plugin.artifactId>
    <!--
        version of test artifact which contains jar files, REQUIRED
        Should be defined in a sub-module
    -->
    <org.apache.maven-dependency-plugin.version></org.apache.maven-dependency-plugin.version>
    <!--
        pattern of resources inside of test artifact to be unpacked in 'unpack'
        phase
    -->
    <org.apache.maven-dependency-plugin.pattern></org.apache.maven-dependency-plugin.pattern>
    <!--
        target folder where all temp. files will be unpacked, OPTIONAL
        Default value is set below
    -->
    <org.apache.maven-dependency-plugin.output>${project.build.directory}</org.apache.maven-dependency-plugin.output>
    <!--
        Type of artifact containing test classes. Default is test-jar
        This equals to classifier="tests"
    -->
    <org.apache.maven-dependency-plugin.type>test-jar</org.apache.maven-dependency-plugin.type>
  </properties>

  <scm>
    <connection>scm:git:https://git-wip-us.apache.org/repos/asf/bigtop.git</connection>
  </scm>

  <dependencies>
    <!-- Turn them on for all children -->
    <!-- Gmaven plugin enables a lot of runtime flexibility for us -->
    <dependency>
      <groupId>org.codehaus.groovy.maven.runtime</groupId>
      <artifactId>gmaven-runtime-1.6</artifactId>
    </dependency>
  </dependencies>

  <build>
    <!-- The following plugins must be enabled inside modules in order to work -->
    <pluginManagement>
      <plugins>
        <!--Let's skip unit tests all together for there are none-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.11</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>

        <!-- Copy the test artifacts so it is easier to deal with it-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>copy-testartifact-jar</id>
              <phase>generate-test-resources</phase>
              <goals>
                <goal>copy</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>${org.apache.maven-dependency-plugin.groupId}</groupId>
                    <artifactId>${org.apache.maven-dependency-plugin.artifactId}</artifactId>
                    <version>${org.apache.maven-dependency-plugin.version}</version>
                    <type>${org.apache.maven-dependency-plugin.type}</type>
                    <outputDirectory>${org.apache.maven-dependency-plugin.output}</outputDirectory>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </execution>
            <execution>
              <id>unpack-testartifact-jar</id>
              <phase>generate-test-resources</phase>
              <goals>
                <goal>unpack</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>${org.apache.maven-dependency-plugin.groupId}</groupId>
                    <artifactId>${org.apache.maven-dependency-plugin.artifactId}</artifactId>
                    <version>${org.apache.maven-dependency-plugin.version}</version>
                    <type>${org.apache.maven-dependency-plugin.type}</type>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                    <includes>${org.apache.maven-dependency-plugin.pattern}</includes>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- This is were actual preparation is started -->
        <plugin>
          <groupId>org.codehaus.groovy.maven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>1.0</version>
          <executions>
            <execution>
              <id>check-testslist</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>execute</goal>
              </goals>
              <configuration>
                <source><![CDATA[
                  import org.apache.bigtop.itest.*

                  def nm   = project.properties['org.apache.maven-dependency-plugin.artifactId'];
                  def vers = project.properties['org.apache.maven-dependency-plugin.version'];
                  def trgt = project.build.directory;

                  def src = project.properties['org.codehaus.groovy.maven.jar'] ?:
                            "${trgt}/${nm}-${vers}.jar";
                  def prefix = project.properties['org.codehaus.groovy.maven.destination'];

                  try {
                    JarContent.listContent(src).each {
                      TestListUtils.touchTestFiles(prefix, it);
                    };
                  } catch (Throwable ex) {
                    println "[WARNING] No test classes were found inside of: ${src}";
                  }
                  ]]>
                </source>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.0</version>
          <executions>
            <execution>
              <id>enforce-property</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireProperty>
                    <property>HADOOP_CONF_DIR</property>
                    <message>HADOOP_CONF_DIR env. variable has to be set</message>
                  </requireProperty>
                  <requireProperty>
                    <property>HADOOP_HOME</property>
                    <message>HADOOP_HOME env. variable has to be set</message>
                  </requireProperty>
                </rules>
                <fail>true</fail>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.11</version>
          <configuration>
            <includes>
              <include>${org.apache.maven-failsafe-plugin.testInclude}</include>
            </includes>
            <excludes>
              <exclude>${org.apache.maven-failsafe-plugin.testExclude}</exclude>
            </excludes>
            <workingDirectory>${project.build.directory}</workingDirectory>
            <systemPropertyVariables>
               <HADOOP_HOME>${HADOOP_HOME}</HADOOP_HOME>
               <log4j.configuration>org.apache.bigtop.itest.log4j.configuration</log4j.configuration>
               <org.apache.bigtop.itest.log4j.level>INFO</org.apache.bigtop.itest.log4j.level>
            </systemPropertyVariables>
            <additionalClasspathElements>
              <additionalClasspathElement>${HADOOP_CONF_DIR}</additionalClasspathElement>
              <org.apache.bigtop.itest.JUnitUtils.results.dir>${project.build.directory}/failsafe-reports</org.apache.bigtop.itest.JUnitUtils.results.dir>
            </additionalClasspathElements>
          </configuration>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>integration-test</goal>
              </goals>
            </execution>
            <execution>
              <id>verify</id>
              <goals>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>
</project>