Skip to content

Commit

Permalink
Labels can't have spaces in them
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou committed Jun 11, 2024
1 parent a6fd799 commit e46a920
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
17 changes: 6 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1489,26 +1489,23 @@ if(BUILD_TESTS)
add_piccolo_test(
NAME pi_ls
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/piccolo_driver.py
CLIENT_BIN ./submit
LABEL "Logging"
CLIENT_BIN ./submit PERF_LABEL "Logging"
ADDITIONAL_ARGS --package "samples/apps/logging/liblogging"
--max-writes-ahead 1000 --repetitions 10000
)

add_piccolo_test(
NAME pi_basic
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/basicperf.py
CLIENT_BIN ./submit
LABEL "Basic"
CLIENT_BIN ./submit PERF_LABEL "Basic"
ADDITIONAL_ARGS --package "samples/apps/basic/libbasic" --client-def
"1,write,100000,primary"
)

add_piccolo_test(
NAME pi_basic_js
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/basicperf.py
CLIENT_BIN ./submit
LABEL "Basic JS"
CLIENT_BIN ./submit PERF_LABEL "Basic JS"
ADDITIONAL_ARGS --js-app-bundle ${CMAKE_SOURCE_DIR}/samples/apps/basic/js
--client-def "1,write,100000,primary"
)
Expand All @@ -1517,8 +1514,7 @@ if(BUILD_TESTS)
add_piccolo_test(
NAME pi_basic_mt
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/basicperf.py
CLIENT_BIN ./submit
LABEL "Basic Multi-Threaded"
CLIENT_BIN ./submit PERF_LABEL "Basic Multi-Threaded"
ADDITIONAL_ARGS --package "samples/apps/basic/libbasic" --client-def
"${WORKER_THREADS},write,100000,primary"
)
Expand All @@ -1527,8 +1523,7 @@ if(BUILD_TESTS)
add_piccolo_test(
NAME pi_ls_jwt
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/piccolo_driver.py
CLIENT_BIN ./submit
LABEL "Logging JWT"
CLIENT_BIN ./submit PERF_LABEL "Logging JWT"
ADDITIONAL_ARGS
--package
"samples/apps/logging/liblogging"
Expand All @@ -1542,7 +1537,7 @@ if(BUILD_TESTS)
add_e2e_test(
NAME historical_query_perf_test
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/historical_query_perf.py
LABEL perf TEST_LABEL "Historical Queries"
LABEL perf PERF_LABEL "Historical Queries"
)
endif()
endif()
Expand Down
24 changes: 12 additions & 12 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ endfunction()
function(add_e2e_test)
cmake_parse_arguments(
PARSE_ARGV 0 PARSED_ARGS ""
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT;TEST_LABEL"
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT;PERF_LABEL"
"CONSTITUTION;ADDITIONAL_ARGS;CONFIGURATIONS;CONTAINER_NODES"
)

Expand Down Expand Up @@ -100,17 +100,17 @@ function(add_e2e_test)
set(NODE_TICK_MS 1)
endif()

if(NOT PARSED_ARGS_TEST_LABEL)
set(PARSED_ARGS_TEST_LABEL ${PARSED_ARGS_NAME})
if(NOT PARSED_ARGS_PERF_LABEL)
set(PARSED_ARGS_PERF_LABEL ${PARSED_ARGS_NAME})
endif()

add_test(
NAME ${PARSED_ARGS_NAME}
COMMAND
${PYTHON_WRAPPER} ${PARSED_ARGS_PYTHON_SCRIPT} -b . --label
${PARSED_ARGS_TEST_LABEL} ${CCF_NETWORK_TEST_ARGS}
${PARSED_ARGS_CONSTITUTION} ${PARSED_ARGS_ADDITIONAL_ARGS} --tick-ms
${NODE_TICK_MS}
${PARSED_ARGS_NAME} --perf-label ${PARSED_ARGS_PERF_LABEL}
${CCF_NETWORK_TEST_ARGS} ${PARSED_ARGS_CONSTITUTION}
${PARSED_ARGS_ADDITIONAL_ARGS} --tick-ms ${NODE_TICK_MS}
CONFIGURATIONS ${PARSED_ARGS_CONFIGURATIONS}
)

Expand Down Expand Up @@ -268,7 +268,7 @@ function(add_piccolo_test)

cmake_parse_arguments(
PARSE_ARGV 0 PARSED_ARGS ""
"NAME;PYTHON_SCRIPT;CONSTITUTION;CLIENT_BIN;LABEL" "ADDITIONAL_ARGS"
"NAME;PYTHON_SCRIPT;CONSTITUTION;CLIENT_BIN;PERF_LABEL" "ADDITIONAL_ARGS"
)

if(NOT PARSED_ARGS_CONSTITUTION)
Expand All @@ -288,18 +288,18 @@ function(add_piccolo_test)

set(TEST_NAME "${PARSED_ARGS_NAME}${TESTS_SUFFIX}")

if(NOT PARSED_ARGS_LABEL)
set(PARSED_ARGS_LABEL ${TEST_NAME})
if(NOT PARSED_ARGS_PERF_LABEL)
set(PARSED_ARGS_PERF_LABEL ${TEST_NAME})
endif()

add_test(
NAME "${PARSED_ARGS_NAME}${TESTS_SUFFIX}"
COMMAND
${PYTHON} ${PARSED_ARGS_PYTHON_SCRIPT} -b . -c ${PARSED_ARGS_CLIENT_BIN}
${CCF_NETWORK_TEST_ARGS} ${PARSED_ARGS_CONSTITUTION} ${VERIFICATION_ARG}
--label ${PARSED_ARGS_LABEL} --snapshot-tx-interval 10000
${PARSED_ARGS_ADDITIONAL_ARGS} -e ${ENCLAVE_TYPE} -t ${ENCLAVE_PLATFORM}
${NODES}
--label ${TEST_NAME} --perf-label ${PARSED_ARGS_PERF_LABEL}
--snapshot-tx-interval 10000 ${PARSED_ARGS_ADDITIONAL_ARGS} -e
${ENCLAVE_TYPE} -t ${ENCLAVE_PLATFORM} ${NODES}
)

# Make python test client framework importable
Expand Down
4 changes: 2 additions & 2 deletions tests/infra/basicperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def run(args):

bf = infra.bencher.Bencher()
bf.set(
args.label,
args.perf_label,
infra.bencher.Memory(
current_value,
high_value=peak_value,
Expand Down Expand Up @@ -590,7 +590,7 @@ def table():

bf = infra.bencher.Bencher()
bf.set(
args.label,
args.perf_label,
infra.bencher.Throughput(round(throughput, 1)),
)

Expand Down
8 changes: 7 additions & 1 deletion tests/infra/e2e_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,13 @@ def cli_args(

default_label = os.path.splitext(os.path.basename(sys.argv[0]))[0]
parser.add_argument(
"--label", help="Unique identifier for the test", default=default_label
"--label",
help="Unique identifier for the test. Must be a valid directory name.",
default=default_label,
)
parser.add_argument(
"--perf-label",
help="Performance test label, not necessarily unique, nor a valid directory name.",
)
parser.add_argument(
"--throws-if-reqs-not-met",
Expand Down
4 changes: 2 additions & 2 deletions tests/infra/piccolo_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def run(get_command, args):
# see basicperf.py for a better, cross-client approach.
bf = infra.bencher.Bencher()
bf.set(
args.label,
args.perf_label,
infra.bencher.Throughput(perf_result),
)

Expand All @@ -228,7 +228,7 @@ def run(get_command, args):

bf = infra.bencher.Bencher()
bf.set(
args.label,
args.perf_label,
infra.bencher.Memory(current_value, high_value=peak_value),
)

Expand Down
2 changes: 1 addition & 1 deletion tests/infra/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def run(get_command, args):

bf = infra.bencher.Bencher()
bf.set(
args.label,
args.perf_label,
infra.bencher.Memory(current_value, high_value=peak_value),
)

Expand Down

0 comments on commit e46a920

Please sign in to comment.