|
@@ -681,8 +681,42 @@ runTests () {
|
|
|
|
|
|
failed_tests=""
|
|
|
modules=$(findModules)
|
|
|
- for module in $modules;
|
|
|
- do
|
|
|
+ #
|
|
|
+ # If we are building hadoop-hdfs-project, we must build the native component
|
|
|
+ # of hadoop-common-project first. In order to accomplish this, we move the
|
|
|
+ # hadoop-hdfs subprojects to the end of the list so that common will come
|
|
|
+ # first.
|
|
|
+ #
|
|
|
+ # Of course, we may not be building hadoop-common at all-- in this case, we
|
|
|
+ # explicitly insert a mvn compile -Pnative of common, to ensure that the
|
|
|
+ # native libraries show up where we need them.
|
|
|
+ #
|
|
|
+ building_common=0
|
|
|
+ for module in $modules; do
|
|
|
+ if [[ $module == hadoop-hdfs-project* ]]; then
|
|
|
+ hdfs_modules="$hdfs_modules $module"
|
|
|
+ elif [[ $module == hadoop-common-project* ]]; then
|
|
|
+ ordered_modules="$ordered_modules $module"
|
|
|
+ building_common=1
|
|
|
+ else
|
|
|
+ ordered_modules="$ordered_modules $module"
|
|
|
+ fi
|
|
|
+ done
|
|
|
+ if [ -n $hdfs_modules ]; then
|
|
|
+ ordered_modules="$ordered_modules $hdfs_modules"
|
|
|
+ if [[ $building_common -eq 0 ]]; then
|
|
|
+ echo " Building hadoop-common with -Pnative in order to provide \
|
|
|
+libhadoop.so to the hadoop-hdfs unit tests."
|
|
|
+ echo " $MVN compile -Pnative -D${PROJECT_NAME}PatchProcess"
|
|
|
+ if ! $MVN compile -Pnative -D${PROJECT_NAME}PatchProcess; then
|
|
|
+ JIRA_COMMENT="$JIRA_COMMENT
|
|
|
+ {color:red}-1 core tests{color}. Failed to build the native portion \
|
|
|
+of hadoop-common prior to running the unit tests in $ordered_modules"
|
|
|
+ return 1
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+ for module in $ordered_modules; do
|
|
|
cd $module
|
|
|
echo " Running tests in $module"
|
|
|
echo " $MVN clean install -fn -Pnative -D${PROJECT_NAME}PatchProcess"
|