Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/fulltests/multi-part-motd/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
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
restart: no
mc:
restart: "no"
restart: no
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
TYPE: PAPER
# regression tests https://github.com/itzg/docker-minecraft-server/issues/2545
MOTD: "Foo§rBar"

28 changes: 16 additions & 12 deletions tests/fulltests/test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/fulltests/vanilla-latest/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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
restart: no
mc:
restart: "no"
restart: no
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
Expand Down
Loading