From a904ba02f3158b971786f2e864fabe5227075cc8 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Fri, 28 Apr 2023 01:00:03 -0500 Subject: [PATCH] enh(run-tests.sh): Sort tests with "general numeric sort" The sort before tended to be alphabetical, which put test `8_force_delete_snapshot` after `815_sync_out-of-order_snapshots`, but `8` should come before `815`. Before: ``` root@demo:~/sanoid/tests/syncoid# ./run-tests.sh Running test 1_bookmark_replication_intermediate ... [PASS] Running test 2_bookmark_replication_no_intermediate ... [PASS] Running test 3_force_delete ... [PASS] Running test 4_bookmark_replication_edge_case ... [PASS] Running test 5_reset_resume_state ... mbuffer: error: outputThread: error writing to at offset 0x90000: Broken pipe mbuffer: warning: error during output to : Broken pipe [PASS] Running test 6_reset_resume_state2 ... [PASS] Running test 7_preserve_recordsize ... [PASS] Running test 815_sync_out-of-order_snapshots ... [PASS] Running test 8_force_delete_snapshot ... [PASS] ``` After: ``` root@demo:~/sanoid/tests/syncoid# ./run-tests.sh Running test 1_bookmark_replication_intermediate ... [PASS] Running test 2_bookmark_replication_no_intermediate ... [PASS] Running test 3_force_delete ... [PASS] Running test 4_bookmark_replication_edge_case ... [PASS] Running test 5_reset_resume_state ... mbuffer: error: outputThread: error writing to at offset 0xf0000: Broken pipe mbuffer: warning: error during output to : Broken pipe [PASS] Running test 6_reset_resume_state2 ... [PASS] Running test 7_preserve_recordsize ... [PASS] Running test 8_force_delete_snapshot ... [PASS] Running test 815_sync_out-of-order_snapshots ... [PASS] ``` --- tests/run-tests.sh | 2 +- tests/syncoid/run-tests.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 38054b0..418657c 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -2,7 +2,7 @@ # run's all the available tests -for test in */; do +for test in $(find . -mindepth 1 -maxdepth 1 -type d -printf "%P\n" | sort -g); do if [ ! -x "${test}/run.sh" ]; then continue fi diff --git a/tests/syncoid/run-tests.sh b/tests/syncoid/run-tests.sh index a9843a5..5564667 100755 --- a/tests/syncoid/run-tests.sh +++ b/tests/syncoid/run-tests.sh @@ -2,7 +2,7 @@ # run's all the available tests -for test in */; do +for test in $(find . -mindepth 1 -maxdepth 1 -type d -printf "%P\n" | sort -g); do if [ ! -x "${test}/run.sh" ]; then continue fi