Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: "Integration test" | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: ./test/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local function wait_map(callback) | ||
local pos = vector.new(5, 30, 5) | ||
for y = 0, 4 do | ||
assert(minetest.forceload_block( | ||
vector.new(pos.x, y*16, pos.z), true, -1 | ||
)) | ||
end | ||
|
||
local function check() | ||
if minetest.get_node(pos).name ~= "ignore" then | ||
return callback(pos) | ||
end | ||
minetest.after(0, check) | ||
end | ||
check() | ||
end | ||
|
||
do | ||
local v = minetest.get_version() | ||
minetest.log("action", "Engine version: " .. (v.hash or v.string)) | ||
end | ||
|
||
minetest.after(0, function() | ||
wait_map(function(pos) | ||
for x = -1, 1 do | ||
for z = -1, 1 do | ||
minetest.add_node(pos:offset(x, 0, z), {name="default:dirt"}) | ||
end | ||
end | ||
|
||
pos = pos:offset(0, 1, 0) | ||
assert(minetest.add_entity(pos, "default:rat") ~= nil) | ||
assert(minetest.add_entity(pos, "default:oerkki1") ~= nil) | ||
assert(minetest.add_entity(pos, "default:firefly") ~= nil) | ||
assert(default.spawn_mobv2(pos, default.get_mob_dungeon_master()) ~= nil) | ||
|
||
minetest.after(2.5, function() | ||
minetest.log("action", "Exiting test run.") | ||
minetest.request_shutdown() | ||
end) | ||
end) | ||
end) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mg_name = v6 | ||
minetest_classic_internal_test = true | ||
max_forceloaded_blocks = 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -e | ||
world=$(mktemp -d) | ||
trap 'rm -rf "$world"' EXIT | ||
|
||
[ -f game.conf ] || { echo "Must be run in game root folder." >&2; exit 1; } | ||
|
||
cp -v test/world.mt "$world/" | ||
chmod -R a+rwX "$world" # needed because server runs as unprivileged user inside container | ||
|
||
[ -z "$DOCKER_IMAGE" ] && DOCKER_IMAGE="ghcr.io/minetest/minetest:master" | ||
docker run --rm -i \ | ||
-v "$PWD/test/minetest.conf":/etc/minetest/minetest.conf \ | ||
--tmpfs /var/lib/minetest/.minetest \ | ||
-v "$PWD":/var/lib/minetest/.minetest/games/minetest_classic \ | ||
-v "$world":/var/lib/minetest/.minetest/world \ | ||
"$DOCKER_IMAGE" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enable_damage = true | ||
creative_mode = false | ||
gameid = minetest_classic |