diff --git dev-support/test-patch.properties dev-support/test-patch.properties index 4ecad34..2995f8e 100644 --- dev-support/test-patch.properties +++ 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" diff --git dev-support/test-patch.sh dev-support/test-patch.sh index f99eefd..39bad3c 100755 --- dev-support/test-patch.sh +++ dev-support/test-patch.sh @@ -200,10 +200,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 +245,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