Skip to content

Commit 2a75296

Browse files
authored
Fix: shell tests are broken and not running on CI (apache#3251)
1 parent 6f85e6d commit 2a75296

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

.github/workflows/bookie-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
- name: Run bookie tests
6464
run: mvn -B -nsu -pl bookkeeper-server test -Dtest="org.apache.bookkeeper.bookie.*Test" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
6565

66+
- name: Run shell tests
67+
run: mvn -B -nsu -pl tests/scripts install -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
68+
6669
- name: Aggregates all test reports to ./test-reports and ./surefire-reports directories If failure
6770
if: failure()
6871
continue-on-error: true

conf/nettyenv.sh

-5
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,3 @@
2323
# netty buffer leak detection level - {@link http://netty.io/wiki/reference-counted-objects.html#wiki-h3-11}
2424
# NETTY_LEAK_DETECTION_LEVEL=
2525

26-
# netty recycler max capacity
27-
# NETTY_RECYCLER_MAXCAPACITY=
28-
29-
# netty recycler link capacity
30-
# NETTY_RECYCLER_LINKCAPACITY=

tests/scripts/src/test/bash/bk_test_bin_common.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ testDefaultVariables() {
3333
assertEquals "BK_HOME is not set correctly" "${BK_HOMEDIR}" "${BK_HOME}"
3434
assertEquals "DEFAULT_LOG_CONF is not set correctly" "${BK_CONFDIR}/log4j2.xml" "${DEFAULT_LOG_CONF}"
3535
assertEquals "NETTY_LEAK_DETECTION_LEVEL is not set correctly" "disabled" "${NETTY_LEAK_DETECTION_LEVEL}"
36-
assertEquals "NETTY_RECYCLER_MAXCAPACITY is not set correctly" "1000" "${NETTY_RECYCLER_MAXCAPACITY}"
37-
assertEquals "NETTY_RECYCLER_LINKCAPACITY is not set correctly" "1024" "${NETTY_RECYCLER_LINKCAPACITY}"
3836
assertEquals "BOOKIE_MAX_HEAP_MEMORY is not set correctly" "1g" "${BOOKIE_MAX_HEAP_MEMORY}"
3937
assertEquals "BOOKIE_MIN_HEAP_MEMORY is not set correctly" "1g" "${BOOKIE_MIN_HEAP_MEMORY}"
4038
assertEquals "BOOKIE_MAX_DIRECT_MEMORY is not set correctly" "2g" "${BOOKIE_MAX_DIRECT_MEMORY}"
@@ -250,8 +248,8 @@ testBuildLoggingOpts() {
250248
TEST_LOG_APPENDER="TEST"
251249

252250
EXPECTED_OPTS="-Dlog4j.configurationFile=${TEST_CONF_FILE} \
253-
-Dbookkeeper.log.root.level=${TEST_LOGGER} \
254-
-Dbookkeeper.log.root.appender=${TEST_LOG_DIR} \
251+
-Dbookkeeper.log.root.level=${TEST_LOG_LEVEL} \
252+
-Dbookkeeper.log.root.appender=${TEST_LOG_APPENDER} \
255253
-Dbookkeeper.log.dir=${TEST_LOG_DIR} \
256254
-Dbookkeeper.log.file=${TEST_LOG_FILE}"
257255
ACTUAL_OPTS=$(build_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_LEVEL} ${TEST_LOG_APPENDER} ${TEST_LOG_DIR} ${TEST_LOG_FILE})
@@ -261,15 +259,17 @@ testBuildLoggingOpts() {
261259

262260
testBuildCLILoggingOpts() {
263261
TEST_CONF_FILE="test.conf"
262+
TEST_LOG_LEVEL="INFO"
263+
TEST_LOG_APPENDER="TEST"
264264
TEST_LOG_DIR="test_log_dir"
265265
TEST_LOG_FILE="test_log_file"
266-
TEST_LOGGER="INFO,TEST"
267266

268267
EXPECTED_OPTS="-Dlog4j.configurationFile=${TEST_CONF_FILE} \
269-
-Dbookkeeper.cli.root.logger=${TEST_LOGGER} \
268+
-Dbookkeeper.cli.log.root.level=${TEST_LOG_LEVEL} \
269+
-Dbookkeeper.cli.log.root.appender=${TEST_LOG_APPENDER} \
270270
-Dbookkeeper.cli.log.dir=${TEST_LOG_DIR} \
271271
-Dbookkeeper.cli.log.file=${TEST_LOG_FILE}"
272-
ACTUAL_OPTS=$(build_cli_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_DIR} ${TEST_LOG_FILE} ${TEST_LOGGER})
272+
ACTUAL_OPTS=$(build_cli_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_LEVEL} ${TEST_LOG_APPENDER} ${TEST_LOG_DIR} ${TEST_LOG_FILE})
273273

274274
assertEquals "Logging OPTS is not set correctly" "${EXPECTED_OPTS}" "${ACTUAL_OPTS}"
275275
}

tests/scripts/src/test/bash/gradle/bk_test_bin_common.sh

+9-8
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ testDefaultVariables() {
3232
assertEquals "BK_HOME is not set correctly" "${BK_HOMEDIR}" "${BK_HOME}"
3333
assertEquals "DEFAULT_LOG_CONF is not set correctly" "${BK_CONFDIR}/log4j2.xml" "${DEFAULT_LOG_CONF}"
3434
assertEquals "NETTY_LEAK_DETECTION_LEVEL is not set correctly" "disabled" "${NETTY_LEAK_DETECTION_LEVEL}"
35-
assertEquals "NETTY_RECYCLER_MAXCAPACITY is not set correctly" "1000" "${NETTY_RECYCLER_MAXCAPACITY}"
36-
assertEquals "NETTY_RECYCLER_LINKCAPACITY is not set correctly" "1024" "${NETTY_RECYCLER_LINKCAPACITY}"
3735
assertEquals "BOOKIE_MAX_HEAP_MEMORY is not set correctly" "1g" "${BOOKIE_MAX_HEAP_MEMORY}"
3836
assertEquals "BOOKIE_MIN_HEAP_MEMORY is not set correctly" "1g" "${BOOKIE_MIN_HEAP_MEMORY}"
3937
assertEquals "BOOKIE_MAX_DIRECT_MEMORY is not set correctly" "2g" "${BOOKIE_MAX_DIRECT_MEMORY}"
@@ -223,11 +221,12 @@ testBuildLoggingOpts() {
223221
TEST_CONF_FILE="test.conf"
224222
TEST_LOG_DIR="test_log_dir"
225223
TEST_LOG_FILE="test_log_file"
226-
TEST_LOGGER="INFO,TEST"
224+
TEST_LOG_LEVEL="INFO"
225+
TEST_LOG_APPENDER="TEST"
227226

228227
EXPECTED_OPTS="-Dlog4j.configurationFile=${TEST_CONF_FILE} \
229-
-Dbookkeeper.log.root.level=${TEST_LOGGER} \
230-
-Dbookkeeper.log.root.appender=${TEST_LOG_DIR} \
228+
-Dbookkeeper.log.root.level=${TEST_LOG_LEVEL} \
229+
-Dbookkeeper.log.root.appender=${TEST_LOG_APPENDER} \
231230
-Dbookkeeper.log.dir=${TEST_LOG_DIR} \
232231
-Dbookkeeper.log.file=${TEST_LOG_FILE}"
233232
ACTUAL_OPTS=$(build_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_LEVEL} ${TEST_LOG_APPENDER} ${TEST_LOG_DIR} ${TEST_LOG_FILE})
@@ -237,15 +236,17 @@ testBuildLoggingOpts() {
237236

238237
testBuildCLILoggingOpts() {
239238
TEST_CONF_FILE="test.conf"
239+
TEST_LOG_LEVEL="INFO"
240+
TEST_LOG_APPENDER="TEST"
240241
TEST_LOG_DIR="test_log_dir"
241242
TEST_LOG_FILE="test_log_file"
242-
TEST_LOGGER="INFO,TEST"
243243

244244
EXPECTED_OPTS="-Dlog4j.configurationFile=${TEST_CONF_FILE} \
245-
-Dbookkeeper.cli.root.logger=${TEST_LOGGER} \
245+
-Dbookkeeper.cli.log.root.level=${TEST_LOG_LEVEL} \
246+
-Dbookkeeper.cli.log.root.appender=${TEST_LOG_APPENDER} \
246247
-Dbookkeeper.cli.log.dir=${TEST_LOG_DIR} \
247248
-Dbookkeeper.cli.log.file=${TEST_LOG_FILE}"
248-
ACTUAL_OPTS=$(build_cli_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_DIR} ${TEST_LOG_FILE} ${TEST_LOGGER})
249+
ACTUAL_OPTS=$(build_cli_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_LEVEL} ${TEST_LOG_APPENDER} ${TEST_LOG_DIR} ${TEST_LOG_FILE})
249250

250251
assertEquals "Logging OPTS is not set correctly" "${EXPECTED_OPTS}" "${ACTUAL_OPTS}"
251252
}

0 commit comments

Comments
 (0)