Skip to content
Snippets Groups Projects
Commit fa079b52 authored by BuckarooBanzay's avatar BuckarooBanzay
Browse files

add integration test

parent 43ecc7d7
No related branches found
No related tags found
No related merge requests found
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
......@@ -71,3 +71,7 @@ end
print("[OK] Mapserver")
if minetest.settings:get_bool("enable_mapserver_integration_test") then
dofile(MP.."/integration_test.lua")
end
#!/bin/sh
# simple integration test
CFG=/tmp/minetest.conf
MTDIR=/tmp/mt
WORLDDIR=${MTDIR}/worlds/world
cat <<EOF > ${CFG}
enable_mapserver_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/mapserver \
registry.gitlab.com/minetest/minetest/server:5.2.0
test -f ${WORLDDIR}/integration_test.json && exit 0 || exit 1
minetest.log("warning", "[TEST] integration-test enabled!")
minetest.register_on_mods_loaded(function()
minetest.after(1, function()
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
file = io.open(minetest.get_worldpath().."/registered_nodes.txt", "w" );
if file then
for name in pairs(minetest.registered_nodes) do
file:write(name .. '\n')
end
file:close()
end
minetest.log("warning", "[TEST] integration tests done!")
minetest.request_shutdown("success")
end)
end)
......@@ -2,6 +2,7 @@
# mapserver mod
![](https://github.com/minetest-mapserver/mapserver_mod/workflows/luacheck/badge.svg)
![](https://github.com/minetest-mapserver/mapserver_mod/workflows/integration-test/badge.svg)
This is the complementary mod for the mapserver: https://github.com/minetest-tools/mapserver
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment