From 30e3b695a17b215a9c10a11c51d29a91ac74f189 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 25 Sep 2023 17:34:38 -0700 Subject: [PATCH] skip crashing tests and mark them as failed --- ci/run-tests.py | 2 +- ci/test.lua | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/run-tests.py b/ci/run-tests.py index f43c7efd4..13eeb099c 100755 --- a/ci/run-tests.py +++ b/ci/run-tests.py @@ -31,7 +31,7 @@ if args.test_dir is not None: if not os.path.isdir(args.test_dir): print('ERROR: invalid test folder: %r' % args.test_dir) -MAX_TRIES = 1 +MAX_TRIES = 5 dfhack = 'Dwarf Fortress.exe' if sys.platform == 'win32' else './dfhack' test_status_file = 'test_status.json' diff --git a/ci/test.lua b/ci/test.lua index 3b5b041ba..372d8f262 100644 --- a/ci/test.lua +++ b/ci/test.lua @@ -645,12 +645,13 @@ local function run_tests(tests, status, counts, config) goto skip end end + -- pre-emptively mark the test as failed in case we induce a crash + status[test.full_name] = TestStatus.FAILED + save_test_status(status) if run_test(test, status, counts) then status[test.full_name] = TestStatus.PASSED - else - status[test.full_name] = TestStatus.FAILED + save_test_status(status) end - save_test_status(status) ::skip:: end local elapsed_ms = dfhack.getTickCount() - start_ms