This commit is contained in:
BuckarooBanzay 2020-07-02 07:28:37 +02:00
parent 2d9b84d429
commit 274f1d5fc5
4 changed files with 0 additions and 72 deletions

View File

@ -1,14 +0,0 @@
name: integration-test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: integration-test
run: ./integration-test.sh

View File

@ -27,7 +27,3 @@ dofile(MP .. "/delete.lua")
dofile(MP .. "/chat.lua")
dofile(MP .. "/globalstep.lua")
dofile(MP .. "/journal.lua")
if minetest.settings:get_bool("enable_mapcleaner_integration_test") then
dofile(MP.."/integration_test.lua")
end

View File

@ -1,20 +0,0 @@
#!/bin/sh
# simple integration test
CFG=/tmp/minetest.conf
MTDIR=/tmp/mt
WORLDDIR=${MTDIR}/worlds/world
cat <<EOF > ${CFG}
enable_mapcleaner_integration_test = true
EOF
mkdir -p ${WORLDDIR}
chmod 777 ${MTDIR} -R
docker run --rm -i \
-v ${CFG}:/etc/minetest/minetest.conf:ro \
-v ${MTDIR}:/var/lib/minetest/.minetest \
-v $(pwd):/var/lib/minetest/.minetest/worlds/world/worldmods/mapcleaner \
registry.gitlab.com/minetest/minetest/server:5.2.0
test -f ${WORLDDIR}/integration_test.json && exit 0 || exit 1

View File

@ -1,34 +0,0 @@
minetest.log("warning", "[TEST] integration-test enabled!")
local function after_emerge()
local data = minetest.write_json({ success = true }, true);
local file = io.open(minetest.get_worldpath().."/integration_test.json", "w" );
if file then
file:write(data)
file:close()
end
minetest.log("warning", "[TEST] integration tests done!")
minetest.request_shutdown("success")
end
local function emerge()
minetest.emerge_area({
x = 0,
y = 0,
z = 0,
}, {
x = 120,
y = 120,
z = 120
}, function(_, _, calls_remaining)
if calls_remaining == 0 then
after_emerge()
end
end)
end
minetest.register_on_mods_loaded(function()
minetest.after(1, emerge)
end)