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:
Yves-Marie Haussonne 2024-10-02 12:36:45 +02:00
parent 02f78d379b
commit cb66508e19
2 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,7 @@
version: "3.2" version: "3.2"
services: services:
server: server:
restart: no restart: "no"
build: build:
dockerfile: Dockerfile dockerfile: Dockerfile
ports: ports:

View File

@ -554,11 +554,9 @@ local run_tests = function()
end end
print("Server tests done, " .. failed .. " tests failed.") 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 return
end end