From ea19c4494f1279fabc6575e9c77c37b4ad0a10bc Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 6 Sep 2017 23:13:21 +0300 Subject: [PATCH] Better test reverse (#1207) * Again fix test 00501_http_head * Better test reverse * Fix test reverse sort * Update clickhouse-test --- dbms/tests/clickhouse-test | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 4b188920d64..58304f1768e 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -93,7 +93,12 @@ def main(args): print("Won't run stateful tests because test data wasn't loaded. See README.txt.") continue - for case in sorted(filter(lambda case: re.search(args.test, case) if args.test else True, os.listdir(suite_dir))): + # Reverse sort order: we want run newest test first. + # And not reverse subtests + def key_func(item): + prefix, suffix = item.split('_', 1) + return -int(prefix), suffix + for case in sorted(filter(lambda case: re.search(args.test, case) if args.test else True, os.listdir(suite_dir)), key=key_func): if SERVER_DIED: break