From 614b27a8bb7f6b1b50f60ed845181f7e07b448b5 Mon Sep 17 00:00:00 2001 From: Aditya Gurajada Date: Wed, 22 Mar 2023 14:25:29 -0700 Subject: [PATCH 1/2] (#554) Enhance test.sh to run a sub-set of tests named by their driving function. This commit now allows running as "test.sh " interface, where the name of the driving function executing a batch of tests can be run independently, without having to go through full execution of all tests. This helps developers shorten their fix-dev-test cycle, especially when validating quick-fixes for long-running tests, like ASAN / MSAN builds. --- test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test.sh b/test.sh index 9ecedddff..dd0db1bef 100755 --- a/test.sh +++ b/test.sh @@ -59,6 +59,13 @@ function usage() { echo "To run CI-regression tests : INCLUDE_SLOW_TESTS=true ./${Me}" echo "To run nightly regression tests : RUN_NIGHTLY_TESTS=true ./${Me}" echo "To run make build-and-test tests : RUN_MAKE_TESTS=true ./${Me}" + echo + echo "To run a smaller collection of slow running tests, +name the function that drives the test execution. +Examples:" + echo " INCLUDE_SLOW_TESTS=true ./test.sh run_btree_tests" + echo " INCLUDE_SLOW_TESTS=true ./test.sh run_splinter_functionality_tests" + echo " INCLUDE_SLOW_TESTS=true ./test.sh nightly_cache_perf_tests" } # ################################################################## @@ -743,6 +750,24 @@ fi # ---- Rest of the coverage runs included in CI test runs ---- +# ------------------------------------------------------------------------ +# Fast-path execution support. You can invoke this script specifying the +# name of one of the functions to execute a specific set of tests. If the +# function takes arguments, pass them on the command-line. This way, one +# can debug script changes to ensure that test-execution still works. +# +# Examples: +# INCLUDE_SLOW_TESTS=true ./test.sh run_btree_tests +# ------------------------------------------------------------------------ +if [ $# -ge 1 ]; then + + # shellcheck disable=SC2048 + $* + record_elapsed_time ${testRunStartSeconds} "All Tests" + cat_exec_log_file + exit 0 +fi + # Run all the unit-tests first, to get basic coverage run_with_timing "Fast unit tests" "$BINDIR"/unit_test From 4dc37ff60854699ce38a56494b91b7b45e962f47 Mon Sep 17 00:00:00 2001 From: Aditya Gurajada Date: Wed, 22 Mar 2023 10:54:35 -0700 Subject: [PATCH 2/2] (#554) Fixes to get couple of tests running cleanly in ASAN-builds This commit fixes minor errors in 2 tests (io_apis_test, filter_test) to get them running cleanly in ASAN-builds. --- tests/functional/filter_test.c | 1 + tests/functional/io_apis_test.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/functional/filter_test.c b/tests/functional/filter_test.c index 3fff94648..2026948c6 100644 --- a/tests/functional/filter_test.c +++ b/tests/functional/filter_test.c @@ -411,6 +411,7 @@ filter_test(int argc, char *argv[]) clockcache_deinit(cc); platform_free(hid, cc); rc_allocator_deinit(&al); + task_system_destroy(hid, &ts); io_handle_deinit(io); free_iohandle: platform_free(hid, io); diff --git a/tests/functional/io_apis_test.c b/tests/functional/io_apis_test.c index 45481b36b..b7c425a38 100644 --- a/tests/functional/io_apis_test.c +++ b/tests/functional/io_apis_test.c @@ -277,7 +277,9 @@ splinter_io_apis_test(int argc, char *argv[]) test_async_reads_by_threads(&io_test_fn_arg, NUM_THREADS); + task_system_destroy(hid, &tasks); io_free: + io_handle_deinit(io_hdl); platform_free(hid, io_hdl); heap_destroy: platform_heap_destroy(&hh);