HBASE-24280 Skip explicit hadoop3 profile activation on master

On 2.x branches, we need to explicitly activate profiles for H3. On
master, all H2 support is dropped which means no special profiles are
required for H3 (though, there is still a profile there to encapsulate
H3 logic).

We need to make sure that the yetus invocation can correctly pass down
any profile information into the personality, so we activate the exact
profiles we want.

Closes #1609

Co-authored-by: Istvan Toth <stoty@cloudera.com>
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Josh Elser 2020-05-01 18:18:06 -04:00
parent 8edcbb4441
commit 99a40ddacf
3 changed files with 25 additions and 7 deletions

View File

@ -145,8 +145,11 @@ function personality_modules
extra="${extra} -Dhttps.protocols=TLSv1.2"
fi
if [[ -n "${HADOOP_PROFILE}" ]]; then
extra="${extra} -Phadoop-${HADOOP_PROFILE}"
# If we have HADOOP_PROFILE specified and we're on branch-2.x, pass along
# the hadoop.profile system property. Ensures that Hadoop2 and Hadoop3
# logic is not both activated within Maven.
if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" =~ branch-2* ]] ; then
extra="${extra} -Dhadoop.profile=${HADOOP_PROFILE}"
fi
# BUILDMODE value is 'full' when there is no patch to be tested, and we are running checks on
@ -458,8 +461,11 @@ function shadedjars_rebuild
'-pl' 'hbase-shaded/hbase-shaded-check-invariants' '-am'
'-Dtest=NoUnitTests' '-DHBasePatchProcess' '-Prelease'
'-Dmaven.javadoc.skip=true' '-Dcheckstyle.skip=true' '-Dspotbugs.skip=true')
if [[ -n "${HADOOP_PROFILE}" ]]; then
maven_args+=("-Phadoop-${HADOOP_PROFILE}")
# If we have HADOOP_PROFILE specified and we're on branch-2.x, pass along
# the hadoop.profile system property. Ensures that Hadoop2 and Hadoop3
# logic is not both activated within Maven.
if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" =~ branch-2* ]] ; then
maven_args+=("-Dhadoop.profile=${HADOOP_PROFILE}")
fi
# disabled because "maven_executor" needs to return both command and args
@ -636,6 +642,10 @@ function hadoopcheck_rebuild
fi
done
hadoop_profile=""
if [[ "${PATCH_BRANCH}" =~ branch-2* ]]; then
hadoop_profile="-Dhadoop.profile=3.0"
fi
for hadoopver in ${hbase_hadoop3_versions}; do
logfile="${PATCH_DIR}/patch-javac-${hadoopver}.txt"
# disabled because "maven_executor" needs to return both command and args
@ -644,7 +654,7 @@ function hadoopcheck_rebuild
$(maven_executor) clean install \
-DskipTests -DHBasePatchProcess \
-Dhadoop-three.version="${hadoopver}" \
-Phadoop-3.0
${hadoop_profile}
count=$(${GREP} -c '\[ERROR\]' "${logfile}")
if [[ ${count} -gt 0 ]]; then
add_vote_table -1 hadoopcheck "${BUILDMODEMSG} causes ${count} errors with Hadoop v${hadoopver}."

View File

@ -76,7 +76,11 @@ fi
# For testing with specific hadoop version. Activates corresponding profile in maven runs.
if [[ -n "${HADOOP_PROFILE}" ]]; then
YETUS_ARGS=("--hadoop-profile=${HADOOP_PROFILE}" "${YETUS_ARGS[@]}")
# Master has only Hadoop3 support. We don't need to activate any profile.
# The Jenkinsfile should not attempt to run any Hadoop2 tests.
if [[ "${BRANCH_NAME}" =~ branch-2* ]]; then
YETUS_ARGS=("--hadoop-profile=${HADOOP_PROFILE}" "${YETUS_ARGS[@]}")
fi
fi
if [[ -n "${SKIP_ERROR_PRONE}" ]]; then

View File

@ -127,7 +127,11 @@ YETUS_ARGS+=("--skip-errorprone")
YETUS_ARGS+=("--skip-dirs=dev-support")
# For testing with specific hadoop version. Activates corresponding profile in maven runs.
if [[ -n "${HADOOP_PROFILE}" ]]; then
YETUS_ARGS+=("--hadoop-profile=${HADOOP_PROFILE}")
# Master has only Hadoop3 support. We don't need to activate any profile.
# The Jenkinsfile should not attempt to run any Hadoop2 tests.
if [[ "${BRANCH_NAME}" =~ branch-2* ]]; then
YETUS_ARGS+=("--hadoop-profile=${HADOOP_PROFILE}")
fi
fi
if [[ -n "${EXCLUDE_TESTS_URL}" ]]; then
YETUS_ARGS+=("--exclude-tests-url=${EXCLUDE_TESTS_URL}")