From fac46d7a2e75f9472793ad727bd4f1c8c4d8db5d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 14 Nov 2025 20:00:01 -0600 Subject: [PATCH 1/2] tests: use service_started condition --- tests/fulltests/multi-part-motd/docker-compose.yml | 4 ++-- tests/fulltests/vanilla-latest/docker-compose.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/fulltests/multi-part-motd/docker-compose.yml b/tests/fulltests/multi-part-motd/docker-compose.yml index 72d24ae192b..3e9b514f8db 100644 --- a/tests/fulltests/multi-part-motd/docker-compose.yml +++ b/tests/fulltests/multi-part-motd/docker-compose.yml @@ -1,7 +1,8 @@ services: monitor: depends_on: - - mc + mc: + condition: service_started image: ${IMAGE_TO_TEST:-itzg/minecraft-server} entrypoint: mc-monitor command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 60 @@ -14,4 +15,3 @@ services: TYPE: PAPER # regression tests https://github.com/itzg/docker-minecraft-server/issues/2545 MOTD: "Foo§rBar" - diff --git a/tests/fulltests/vanilla-latest/docker-compose.yml b/tests/fulltests/vanilla-latest/docker-compose.yml index 1e39bb17c06..e731ed8fcd2 100644 --- a/tests/fulltests/vanilla-latest/docker-compose.yml +++ b/tests/fulltests/vanilla-latest/docker-compose.yml @@ -1,7 +1,8 @@ services: monitor: depends_on: - - mc + mc: + condition: service_started image: ${IMAGE_TO_TEST:-itzg/minecraft-server} entrypoint: mc-monitor command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 300 From 899631c498c83f6e827dee1281c3ffd2d08efb62 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 14 Nov 2025 20:19:32 -0600 Subject: [PATCH 2/2] Use up instead of run --- .../multi-part-motd/docker-compose.yml | 3 +- tests/fulltests/test.sh | 28 +++++++++++-------- .../vanilla-latest/docker-compose.yml | 3 +- 3 files changed, 20 insertions(+), 14 deletions(-) mode change 100644 => 100755 tests/fulltests/test.sh diff --git a/tests/fulltests/multi-part-motd/docker-compose.yml b/tests/fulltests/multi-part-motd/docker-compose.yml index 3e9b514f8db..a84b9adb463 100644 --- a/tests/fulltests/multi-part-motd/docker-compose.yml +++ b/tests/fulltests/multi-part-motd/docker-compose.yml @@ -6,8 +6,9 @@ services: image: ${IMAGE_TO_TEST:-itzg/minecraft-server} entrypoint: mc-monitor command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 60 + restart: no mc: - restart: "no" + restart: no image: ${IMAGE_TO_TEST:-itzg/minecraft-server} environment: EULA: "TRUE" diff --git a/tests/fulltests/test.sh b/tests/fulltests/test.sh old mode 100644 new mode 100755 index 7e48ab96150..a1bde85c07d --- a/tests/fulltests/test.sh +++ b/tests/fulltests/test.sh @@ -3,24 +3,28 @@ # go to script root directory cd "$(dirname "$0")" || exit 1 -down() { - docker compose -f "$1" down -v --remove-orphans -} - # tests to completely spin up Minecraft and use the monitor to validate the service is running. fullMinecraftUpTest(){ file="$1" - failed=false + result=0 + + echo "Testing with images:" + docker compose -f "$file" config --images + # run the monitor to validate the Minecraft image is healthy - docker compose -f "$file" run monitor || failed=true - echo "$(dirname "$file") Result: failed=$failed" - if $failed; then - docker compose logs mc - down "$file" - return 1 + upArgs=( + --attach-dependencies + --always-recreate-deps + --abort-on-container-failure + ) + if ! docker compose -f "$file" up "${upArgs[@]}" monitor; then + echo "$(dirname "$file") Result: failed" + result=1 else - down "$file" + echo "$(dirname "$file") Result: success" fi + docker compose -f "$file" down -v --remove-orphans + return $result } # go through each folder in fulltests and run fullbuilds diff --git a/tests/fulltests/vanilla-latest/docker-compose.yml b/tests/fulltests/vanilla-latest/docker-compose.yml index e731ed8fcd2..891f4970605 100644 --- a/tests/fulltests/vanilla-latest/docker-compose.yml +++ b/tests/fulltests/vanilla-latest/docker-compose.yml @@ -6,8 +6,9 @@ services: image: ${IMAGE_TO_TEST:-itzg/minecraft-server} entrypoint: mc-monitor command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 300 + restart: no mc: - restart: "no" + restart: no image: ${IMAGE_TO_TEST:-itzg/minecraft-server} environment: EULA: "TRUE"