Skip to content

Commit 74fb204

Browse files
dbistbusbey
authored andcommitted
HBASE-22464 Improvements to hbase-vote script
* wget should use timestamps to avoid re-downloading RC artifacts we already have. * allow changing to maven profiles other than runAllTests for test step Signed-off-by: Sean Busbey <busbey@apache.org>
1 parent 767bb15 commit 74fb204

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

dev-support/hbase-vote.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ hbase-vote. A script for standard vote which verifies the following items
2929
4. Built from source
3030
5. Unit tests
3131
32-
Usage: ${SCRIPT} -s | --source <url> [-k | --key <signature>] [-f | --keys-file-url <url>] [-o | --output-dir </path/to/use>]
32+
Usage: ${SCRIPT} -s | --source <url> [-k | --key <signature>] [-f | --keys-file-url <url>] [-o | --output-dir </path/to/use>] [-P runSmallTests]
3333
${SCRIPT} -h | --help
3434
3535
-h | --help Show this screen.
@@ -39,6 +39,7 @@ Usage: ${SCRIPT} -s | --source <url> [-k | --key <signature>] [-f | --keys-file-
3939
-f | --keys-file-url '<url>' the URL of the key file, default is
4040
http://www.apache.org/dist/hbase/KEYS
4141
-o | --output-dir '</path>' directory which has the stdout and stderr of each verification target
42+
-P | list of maven profiles to activate for test UT/IT, i.e. <-P runSmallTests> Defaults to runAllTests
4243
__EOF
4344
}
4445

@@ -54,6 +55,8 @@ while ((${#})); do
5455
KEY_FILE_URL="${2}"; shift 2 ;;
5556
-o | --output-dir )
5657
OUTPUT_DIR="${2}"; shift 2 ;;
58+
-P )
59+
MVN_ARGS="-P ${2}"; shift 2 ;;
5760
* )
5861
usage >&2; exit 1 ;;
5962
esac
@@ -85,6 +88,11 @@ if [ ! -d "${OUTPUT_DIR}" ]; then
8588
exit 1
8689
fi
8790

91+
# Maven profile must be provided
92+
if [ -z "${MVN_ARGS}" ]; then
93+
MVN_ARGS="-P runAllTests"
94+
fi
95+
8896
OUTPUT_PATH_PREFIX="${OUTPUT_DIR}"/"${HBASE_RC_VERSION}"
8997

9098
# default value for verification targets, 0 = failed
@@ -107,7 +115,7 @@ function download_and_import_keys() {
107115

108116
function download_release_candidate () {
109117
# get all files from release candidate repo
110-
wget -r -np -nH --cut-dirs 4 "${SOURCE_URL}"
118+
wget -r -np -N -nH --cut-dirs 4 "${SOURCE_URL}"
111119
}
112120

113121
function verify_signatures() {
@@ -142,9 +150,9 @@ function build_from_source() {
142150
mvn clean install -DskipTests 2>&1 | tee "${OUTPUT_PATH_PREFIX}"_build_from_source && BUILD_FROM_SOURCE_PASSED=1
143151
}
144152

145-
function run_all_tests() {
146-
rm -f "${OUTPUT_PATH_PREFIX}"_run_all_tests
147-
mvn test -fae -P runAllTests -Dsurefire.rerunFailingTestsCount=3 2>&1 | tee "${OUTPUT_PATH_PREFIX}"_run_all_tests && UNIT_TEST_PASSED=1
153+
function run_tests() {
154+
rm -f "${OUTPUT_PATH_PREFIX}"_run_tests
155+
mvn package "${MVN_ARGS}" -Dsurefire.rerunFailingTestsCount=3 2>&1 | tee "${OUTPUT_PATH_PREFIX}"_run_tests && UNIT_TEST_PASSED=1
148156
}
149157

150158
function execute() {
@@ -160,7 +168,7 @@ function print_when_exit() {
160168
* Built from source (${JAVA_VERSION}): $( ((BUILD_FROM_SOURCE_PASSED)) && echo "ok" || echo "failed" )
161169
- mvn clean install -DskipTests
162170
* Unit tests pass (${JAVA_VERSION}): $( ((UNIT_TEST_PASSED)) && echo "ok" || echo "failed" )
163-
- mvn test -P runAllTests
171+
- mvn package ${MVN_ARGS}
164172
__EOF
165173
if ((CHECKSUM_PASSED)) && ((SIGNATURE_PASSED)) && ((RAT_CHECK_PASSED)) && ((BUILD_FROM_SOURCE_PASSED)) && ((UNIT_TEST_PASSED)) ; then
166174
exit 0
@@ -177,7 +185,7 @@ execute verify_checksums
177185
execute unzip_from_source
178186
execute rat_test
179187
execute build_from_source
180-
execute run_all_tests
188+
execute run_tests
181189

182190
popd
183191

0 commit comments

Comments
 (0)