HBASE-12920 hadoopqa should compile with different hadoop versions
This commit is contained in:
parent
d5a2830777
commit
e83444e845
|
@ -28,3 +28,7 @@ MAX_LINE_LENGTH=100
|
|||
# All supported branches for testing with precommit build
|
||||
# branch-1.x should apprear before branch-1 since the latter is a prefix
|
||||
BRANCH_NAMES="0.94 0.98 branch-1.0 branch-1 master"
|
||||
|
||||
# All supported Hadoop versions that we want to test the compilation with
|
||||
HADOOP2_VERSIONS="2.4.1 2.5.2 2.6.0"
|
||||
HADOOP3_VERSIONS="3.0.0-SNAPSHOT"
|
||||
|
|
|
@ -377,17 +377,21 @@ checkTests () {
|
|||
### Check there are no compilation errors, passing a file to be parsed.
|
||||
checkCompilationErrors() {
|
||||
local file=$1
|
||||
hadoopVersion=""
|
||||
if [ "$#" -ne 1 ]; then
|
||||
hadoopVersion="with Hadoop version $2"
|
||||
fi
|
||||
COMPILATION_ERROR=false
|
||||
eval $(awk '/ERROR/ {print "COMPILATION_ERROR=true"}' $file)
|
||||
if $COMPILATION_ERROR ; then
|
||||
ERRORS=$($AWK '/ERROR/ { print $0 }' $file)
|
||||
echo "======================================================================"
|
||||
echo "There are compilation errors."
|
||||
echo "There are compilation errors $hadoopVersion."
|
||||
echo "======================================================================"
|
||||
echo "$ERRORS"
|
||||
JIRA_COMMENT="$JIRA_COMMENT
|
||||
|
||||
{color:red}-1 javac{color}. The patch appears to cause mvn compile goal to fail.
|
||||
{color:red}-1 javac{color}. The patch appears to cause mvn compile goal to fail $hadoopVersion.
|
||||
|
||||
Compilation errors resume:
|
||||
$ERRORS
|
||||
|
@ -504,6 +508,30 @@ $JIRA_COMMENT_FOOTER"
|
|||
return 0
|
||||
}
|
||||
|
||||
checkBuildWithHadoopVersions() {
|
||||
echo ""
|
||||
echo ""
|
||||
echo "======================================================================"
|
||||
echo "======================================================================"
|
||||
echo " Building with all supported Hadoop versions ."
|
||||
echo "======================================================================"
|
||||
echo "======================================================================"
|
||||
echo ""
|
||||
echo ""
|
||||
export MAVEN_OPTS="${MAVEN_OPTS}"
|
||||
for HADOOP2_VERSION in $HADOOP2_VERSIONS ; do
|
||||
echo "$MVN clean install -DskipTests -D${PROJECT_NAME}PatchProcess -Dhadoop-two.version=$HADOOP2_VERSION > $PATCH_DIR/patchJavacWithHadoop-$HADOOP2_VERSION.txt 2>&1"
|
||||
$MVN clean install -DskipTests -D${PROJECT_NAME}PatchProcess -Dhadoop-two.version=$HADOOP2_VERSION > $PATCH_DIR/patchJavacWithHadoop-$HADOOP2_VERSION.txt 2>&1
|
||||
checkCompilationErrors $PATCH_DIR/patchJavacWithHadoop-$HADOOP2_VERSION.txt $HADOOP2_VERSION
|
||||
done
|
||||
|
||||
# TODO: add Hadoop3 versions and compilation here when we get the hadoop.profile=3.0 working
|
||||
|
||||
JIRA_COMMENT="$JIRA_COMMENT
|
||||
{color:green}+1 hadoop versions{color}. The patch compiles with all supported hadoop versions ($HADOOP2_VERSIONS)"
|
||||
return 0
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
### Check there are no changes in the number of Javac warnings
|
||||
checkJavacWarnings () {
|
||||
|
@ -956,6 +984,8 @@ fi
|
|||
|
||||
checkAntiPatterns
|
||||
(( RESULT = RESULT + $? ))
|
||||
checkBuildWithHadoopVersions
|
||||
(( RESULT = RESULT + $? ))
|
||||
checkJavacWarnings
|
||||
(( RESULT = RESULT + $? ))
|
||||
checkProtocErrors
|
||||
|
|
Loading…
Reference in New Issue