Skip to content

Commit

Permalink
refactor(test): use semicolon instead of comma to separate each optio…
Browse files Browse the repository at this point in the history
…n in TEST_OPTS (apache#1854)

Now options in TEST_OPTS  are separated by comma. However, some
options contains commas itself. We could use semicolon instead of
comma.
  • Loading branch information
Samunroyu authored Jan 18, 2024
1 parent 09dc9e0 commit 1951952
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_and_test_cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ on:
env:
# Update the options to reduce the consumption of the disk space
ONEBOX_OPTS: disk_min_available_space_ratio=5
TEST_OPTS: disk_min_available_space_ratio=5,throttle_test_medium_value_kb=10,throttle_test_large_value_kb=25
TEST_OPTS: disk_min_available_space_ratio=5;throttle_test_medium_value_kb=10;throttle_test_large_value_kb=25

jobs:
cpp_clang_format_linter:
Expand Down
10 changes: 5 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -484,16 +484,16 @@ function run_test()
# Update options if needed, this should be done before starting onebox to make new options take effect.
if [ "${module}" == "recovery_test" ]; then
master_count=1
opts="meta_state_service_type=meta_state_service_simple,distributed_lock_service_type=distributed_lock_service_simple"
opts="meta_state_service_type=meta_state_service_simple;distributed_lock_service_type=distributed_lock_service_simple"
fi
if [ "${module}" == "backup_restore_test" ]; then
opts="cold_backup_disabled=false,cold_backup_checkpoint_reserve_minutes=0,cold_backup_root=onebox"
opts="cold_backup_disabled=false;cold_backup_checkpoint_reserve_minutes=0;cold_backup_root=onebox"
fi
if [ "${module}" == "restore_test" ]; then
opts="cold_backup_disabled=false,cold_backup_checkpoint_reserve_minutes=0,cold_backup_root=onebox"
opts="cold_backup_disabled=false;cold_backup_checkpoint_reserve_minutes=0;cold_backup_root=onebox"
fi
# Append onebox_opts if needed.
[ -z ${onebox_opts} ] || opts="${opts},${onebox_opts}"
[ -z ${onebox_opts} ] || opts="${opts};${onebox_opts}"
# Start onebox.
if ! run_start_onebox -m ${master_count} -w -c --opts ${opts}; then
echo "ERROR: unable to continue on testing because starting onebox failed"
Expand Down Expand Up @@ -844,7 +844,7 @@ function run_start_onebox()
fi

OPTS=`echo $OPTS | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/common/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/meta/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/replica/backup/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/replica/bulk_load/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/replica/duplication/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/replica/split/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/replica/storage/simple_kv/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
6 changes: 3 additions & 3 deletions src/replica/storage/simple_kv/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function run_single()
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down Expand Up @@ -113,12 +113,12 @@ fi

if [ ! -z "${cases}" ]; then
OLD_TEST_OPTS=${TEST_OPTS}
TEST_OPTS=${OLD_TEST_OPTS},encrypt_data_at_rest=false
TEST_OPTS="${OLD_TEST_OPTS};encrypt_data_at_rest=false"
for id in ${cases}; do
run_case ${id}
echo
done
TEST_OPTS=${OLD_TEST_OPTS},encrypt_data_at_rest=true
TEST_OPTS="${OLD_TEST_OPTS};encrypt_data_at_rest=true"
for id in ${cases}; do
run_case ${id}
echo
Expand Down
2 changes: 1 addition & 1 deletion src/replica/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/server/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down
2 changes: 1 addition & 1 deletion src/test/function_test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -n ${TEST_OPTS} ]; then
fi

OPTS=`echo ${TEST_OPTS} | xargs`
config_kvs=(${OPTS//,/ })
config_kvs=(${OPTS//;/ })
for config_kv in ${config_kvs[@]}; do
config_kv=`echo $config_kv | xargs`
kv=(${config_kv//=/ })
Expand Down

0 comments on commit 1951952

Please sign in to comment.