cleanup
This commit is contained in:
parent
2d9b84d429
commit
274f1d5fc5
14
.github/workflows/integration-test.yml
vendored
14
.github/workflows/integration-test.yml
vendored
@ -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
|
|
4
init.lua
4
init.lua
@ -27,7 +27,3 @@ dofile(MP .. "/delete.lua")
|
|||||||
dofile(MP .. "/chat.lua")
|
dofile(MP .. "/chat.lua")
|
||||||
dofile(MP .. "/globalstep.lua")
|
dofile(MP .. "/globalstep.lua")
|
||||||
dofile(MP .. "/journal.lua")
|
dofile(MP .. "/journal.lua")
|
||||||
|
|
||||||
if minetest.settings:get_bool("enable_mapcleaner_integration_test") then
|
|
||||||
dofile(MP.."/integration_test.lua")
|
|
||||||
end
|
|
||||||
|
@ -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
|
|
@ -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)
|
|
Loading…
x
Reference in New Issue
Block a user