@@ -29,7 +29,7 @@ hbase-vote. A script for standard vote which verifies the following items
29
29
4. Built from source
30
30
5. Unit tests
31
31
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]
33
33
${SCRIPT} -h | --help
34
34
35
35
-h | --help Show this screen.
@@ -39,6 +39,7 @@ Usage: ${SCRIPT} -s | --source <url> [-k | --key <signature>] [-f | --keys-file-
39
39
-f | --keys-file-url '<url>' the URL of the key file, default is
40
40
http://www.apache.org/dist/hbase/KEYS
41
41
-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
42
43
__EOF
43
44
}
44
45
@@ -54,6 +55,8 @@ while ((${#})); do
54
55
KEY_FILE_URL=" ${2} " ; shift 2 ;;
55
56
-o | --output-dir )
56
57
OUTPUT_DIR=" ${2} " ; shift 2 ;;
58
+ -P )
59
+ MVN_ARGS=" -P ${2} " ; shift 2 ;;
57
60
* )
58
61
usage >&2 ; exit 1 ;;
59
62
esac
@@ -85,6 +88,11 @@ if [ ! -d "${OUTPUT_DIR}" ]; then
85
88
exit 1
86
89
fi
87
90
91
+ # Maven profile must be provided
92
+ if [ -z " ${MVN_ARGS} " ]; then
93
+ MVN_ARGS=" -P runAllTests"
94
+ fi
95
+
88
96
OUTPUT_PATH_PREFIX=" ${OUTPUT_DIR} " /" ${HBASE_RC_VERSION} "
89
97
90
98
# default value for verification targets, 0 = failed
@@ -107,7 +115,7 @@ function download_and_import_keys() {
107
115
108
116
function download_release_candidate () {
109
117
# 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} "
111
119
}
112
120
113
121
function verify_signatures() {
@@ -142,9 +150,9 @@ function build_from_source() {
142
150
mvn clean install -DskipTests 2>&1 | tee " ${OUTPUT_PATH_PREFIX} " _build_from_source && BUILD_FROM_SOURCE_PASSED=1
143
151
}
144
152
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
148
156
}
149
157
150
158
function execute() {
@@ -160,7 +168,7 @@ function print_when_exit() {
160
168
* Built from source (${JAVA_VERSION} ): $( (( BUILD_FROM_SOURCE_PASSED)) && echo " ok" || echo " failed" )
161
169
- mvn clean install -DskipTests
162
170
* Unit tests pass (${JAVA_VERSION} ): $( (( UNIT_TEST_PASSED)) && echo " ok" || echo " failed" )
163
- - mvn test -P runAllTests
171
+ - mvn package ${MVN_ARGS}
164
172
__EOF
165
173
if (( CHECKSUM_PASSED)) && (( SIGNATURE_PASSED)) && (( RAT_CHECK_PASSED)) && (( BUILD_FROM_SOURCE_PASSED)) && (( UNIT_TEST_PASSED)) ; then
166
174
exit 0
@@ -177,7 +185,7 @@ execute verify_checksums
177
185
execute unzip_from_source
178
186
execute rat_test
179
187
execute build_from_source
180
- execute run_all_tests
188
+ execute run_tests
181
189
182
190
popd
183
191
0 commit comments