Repository: hbase Updated Branches: refs/heads/master 9c37d5dab -> eaacc5a0c
HBASE-12944 Support patches to branches in precommit jenkins build Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/eaacc5a0 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/eaacc5a0 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/eaacc5a0 Branch: refs/heads/master Commit: eaacc5a0ce73252566997e4c71aedc0bd2e88328 Parents: 9c37d5d Author: Enis Soztutar <e...@apache.org> Authored: Thu Jan 29 14:42:53 2015 -0800 Committer: Enis Soztutar <e...@apache.org> Committed: Thu Jan 29 14:42:53 2015 -0800 ---------------------------------------------------------------------- dev-support/test-patch.properties | 4 ++++ dev-support/test-patch.sh | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/eaacc5a0/dev-support/test-patch.properties ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.properties b/dev-support/test-patch.properties index 4ecad34..2995f8e 100644 --- a/dev-support/test-patch.properties +++ b/dev-support/test-patch.properties @@ -24,3 +24,7 @@ OK_FINDBUGS_WARNINGS=95 OK_JAVADOC_WARNINGS=2 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" http://git-wip-us.apache.org/repos/asf/hbase/blob/eaacc5a0/dev-support/test-patch.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index f99eefd..e1e6698 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -32,6 +32,7 @@ PROJECT_NAME=HBase JENKINS=false PATCH_DIR=/tmp BASEDIR=$(pwd) +BRANCH_NAME="master" PS=${PS:-ps} AWK=${AWK:-awk} @@ -200,10 +201,28 @@ checkout () { fi fi echo + else + if [[ $BRANCH_NAME -ne "master" ]]; then + echo "${GIT} checkout ${BRANCH_NAME}" + ${GIT} checkout ${BRANCH_NAME} + echo "${GIT} status" + ${GIT} status + fi fi return $? } +findBranchNameFromPatchName() { + local patchName=$1 + for LOCAL_BRANCH_NAME in $BRANCH_NAMES; do + if [[ $patchName =~ .*$LOCAL_BRANCH_NAME.* ]]; then + BRANCH_NAME=$LOCAL_BRANCH_NAME + break + fi + done + return 0 +} + ############################################################################### setup () { ### Download latest patch file (ignoring .htm and .html) when run from patch process @@ -227,9 +246,10 @@ setup () { echo "$patchURL" $WGET -q -O $PATCH_DIR/patch $patchURL VERSION=${GIT_COMMIT}_${defect}_PATCH-${patchNum} + findBranchNameFromPatchName ${relativePatchURL} JIRA_COMMENT="Here are the results of testing the latest attachment $patchURL - against master branch at commit ${GIT_COMMIT}. + against ${BRANCH_NAME} branch at commit ${GIT_COMMIT}. ATTACHMENT ID: ${ATTACHMENT_ID}" ### Copy the patch file to $PATCH_DIR