refactor(base.lua): improve test completion logic
Refactored the test completion logic in the `run_tests` function for better readability and maintainability. Removed redundant check for `minetest.settings:get_bool("test_harness_stop_server", true)` and streamlined the conditional flow based on `tests_state`. This change enhances code clarity without altering functionality significantly.
This commit is contained in:
parent
02f78d379b
commit
cb66508e19
@ -1,7 +1,7 @@
|
||||
version: "3.2"
|
||||
services:
|
||||
server:
|
||||
restart: no
|
||||
restart: "no"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
|
6
base.lua
6
base.lua
@ -554,11 +554,9 @@ local run_tests = function()
|
||||
end
|
||||
|
||||
print("Server tests done, " .. failed .. " tests failed.")
|
||||
if minetest.settings:get_bool("test_harness_stop_server", true) and ( next(players_tests) == nil or tests_state == TESTS_STATE_ENUM.DONE) then
|
||||
request_shutdown()
|
||||
end
|
||||
|
||||
if tests_state == TESTS_STATE_ENUM.DONE then
|
||||
if next(players_tests) == nil or tests_state == TESTS_STATE_ENUM.DONE then
|
||||
set_tests_done()
|
||||
return
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user