forked from mt-mods/technic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor integration tests (mt-mods#281)
* refactor integration tests * set deprecated_lua_api_handling to 'error' Co-authored-by: BuckarooBanzay <[email protected]>
- Loading branch information
1 parent
5dbb061
commit b4cde13
Showing
12 changed files
with
231 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,11 @@ | ||
ARG ENGINE_VERSION=5.5.0 | ||
FROM registry.gitlab.com/minetest/minetest/server:${ENGINE_VERSION} | ||
|
||
USER root | ||
RUN apk add git &&\ | ||
mkdir -p /root/.minetest/worlds/world/worldmods/ &&\ | ||
cd /root/.minetest/worlds/world/worldmods/ &&\ | ||
git clone --depth 1 https://github.com/BuckarooBanzay/mtt &&\ | ||
git clone --recurse-submodules --depth 1 https://github.com/mt-mods/basic_materials.git &&\ | ||
git clone --depth 1 https://github.com/mt-mods/pipeworks.git &&\ | ||
git clone --depth 1 https://github.com/minetest-mods/moreores.git |
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,4 @@ | ||
default_game = minetest_game | ||
mg_name = v7 | ||
mtt_enable = true | ||
deprecated_lua_api_handling = error |
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,176 @@ | ||
technic:dummy_light_source | ||
technic:lv_lamp_active | ||
technic:lv_cable_plate_2 | ||
technic:lv_cable_plate_6 | ||
technic:lv_battery_box0 | ||
technic:mv_electric_furnace_active | ||
technic:mv_alloy_furnace_active | ||
technic:mv_compressor | ||
technic:mv_grinder | ||
technic:mv_grinder_active | ||
technic:lv_battery_box1 | ||
technic:lv_battery_box2 | ||
technic:mv_cable_plate_6 | ||
technic:mv_battery_box3 | ||
technic:power_monitor | ||
technic:mv_battery_box4 | ||
technic:mv_battery_box5 | ||
technic:mv_battery_box7 | ||
technic:mv_battery_box8 | ||
technic:mv_generator | ||
technic:mv_solar_array | ||
technic:hydro_turbine | ||
technic:lv_cable_plate_1 | ||
technic:mv_cable_plate_1 | ||
technic:hv_cable | ||
technic:hv_cable_plate_1 | ||
technic:lv_battery_box3 | ||
technic:lv_battery_box7 | ||
technic:solar_panel | ||
technic:lv_solar_array | ||
technic:geothermal | ||
technic:water_mill_active | ||
technic:supply_converter | ||
technic:lv_generator | ||
technic:lv_generator_active | ||
technic:admin_anchor | ||
technic:coal_alloy_furnace_active | ||
technic:constructor_mk3_on | ||
technic:constructor_mk1_off | ||
technic:constructor_mk2_on | ||
technic:constructor_mk2_off | ||
technic:lv_grinder | ||
technic:constructor_mk1_on | ||
technic:injector | ||
technic:switching_station | ||
technic:hv_compressor_active | ||
technic:hv_compressor | ||
technic:lv_led | ||
technic:hv_grinder_active | ||
technic:hv_grinder | ||
technic:hv_electric_furnace_active | ||
technic:hv_electric_furnace | ||
technic:forcefield | ||
technic:lv_compressor | ||
technic:hv_nuclear_reactor_core | ||
technic:hv_solar_array | ||
technic:hv_battery_box8 | ||
technic:hv_battery_box7 | ||
technic:hv_battery_box5 | ||
technic:hv_battery_box4 | ||
technic:hv_battery_box3 | ||
technic:hv_battery_box1 | ||
technic:hv_battery_box0 | ||
technic:uranium1_block | ||
technic:uranium20_block | ||
technic:hv_cable_plate_3 | ||
technic:uranium31_block | ||
technic:hv_cable_plate_2 | ||
technic:mv_freezer_active | ||
technic:mv_freezer | ||
technic:tool_workshop | ||
technic:mv_centrifuge_active | ||
technic:mv_centrifuge | ||
technic:mv_compressor_active | ||
technic:mv_extractor_active | ||
technic:mv_extractor | ||
technic:mv_electric_furnace | ||
technic:mv_alloy_furnace | ||
technic:hydro_turbine_active | ||
technic:mv_generator_active | ||
technic:mv_battery_box6 | ||
technic:mv_battery_box2 | ||
technic:mv_battery_box1 | ||
technic:uranium33_block | ||
technic:mv_battery_box0 | ||
technic:mv_cable_plate_5 | ||
technic:mv_cable_plate_4 | ||
technic:mv_cable_plate_3 | ||
technic:mv_cable_plate_2 | ||
technic:mv_cable | ||
technic:uranium34_block | ||
technic:lv_lamp | ||
technic:lv_led_active | ||
technic:music_player | ||
technic:uranium35_block | ||
technic:lv_compressor_active | ||
technic:lv_extractor_active | ||
technic:uranium9_block | ||
technic:lv_extractor | ||
technic:lv_grinder_active | ||
technic:lv_electric_furnace_active | ||
technic:lv_electric_furnace | ||
technic:uranium10_block | ||
technic:lv_alloy_furnace_active | ||
technic:lv_alloy_furnace | ||
technic:carbon_steel_block | ||
technic:stainless_steel_block | ||
technic:water_mill | ||
technic:sulfur_block | ||
technic:geothermal_active | ||
technic:lv_battery_box8 | ||
technic:lv_battery_box6 | ||
technic:lv_battery_box5 | ||
technic:lv_battery_box4 | ||
technic:uranium12_block | ||
technic:lv_cable_plate_5 | ||
technic:lv_cable_plate_4 | ||
technic:lv_cable_plate_3 | ||
technic:lv_cable | ||
technic:uranium13_block | ||
technic:chernobylite_block | ||
technic:uranium8_block | ||
technic:uranium11_block | ||
technic:uranium32_block | ||
technic:uranium30_block | ||
technic:uranium29_block | ||
technic:uranium28_block | ||
technic:uranium27_block | ||
technic:uranium26_block | ||
technic:uranium25_block | ||
technic:uranium24_block | ||
technic:uranium23_block | ||
technic:hv_cable_plate_4 | ||
technic:uranium16_block | ||
technic:hv_cable_plate_5 | ||
technic:hv_cable_plate_6 | ||
technic:uranium18_block | ||
technic:uranium17_block | ||
technic:uranium15_block | ||
technic:uranium14_block | ||
technic:corium_flowing | ||
technic:corium_source | ||
technic:hv_battery_box2 | ||
technic:uranium2_block | ||
technic:uranium19_block | ||
technic:uranium0_block | ||
technic:hv_battery_box6 | ||
technic:mineral_chromium | ||
technic:mineral_lead | ||
technic:mineral_sulfur | ||
technic:granite | ||
technic:uranium21_block | ||
technic:granite_bricks | ||
technic:marble | ||
technic:marble_bricks | ||
technic:uranium_block | ||
technic:chromium_block | ||
technic:uranium22_block | ||
technic:zinc_block | ||
technic:lead_block | ||
technic:cast_iron_block | ||
technic:uranium3_block | ||
technic:uranium4_block | ||
technic:uranium5_block | ||
technic:uranium6_block | ||
technic:hv_nuclear_reactor_core_active | ||
technic:hv_generator | ||
technic:hv_generator_active | ||
technic:machine_casing | ||
technic:mineral_uranium | ||
technic:quarry | ||
technic:forcefield_emitter_off | ||
technic:constructor_mk3_off | ||
technic:coal_alloy_furnace | ||
technic:mineral_zinc | ||
technic:forcefield_emitter_on |
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,20 @@ | ||
version: "3.6" | ||
|
||
services: | ||
test: | ||
build: | ||
context: ./.test | ||
args: | ||
ENGINE_VERSION: ${ENGINE_VERSION:-5.5.0} | ||
entrypoint: "minetestserver --config /minetest.conf" | ||
user: root | ||
volumes: | ||
- "./:/root/.minetest/worlds/world/worldmods/technic/" | ||
- "./.test/minetest.conf:/minetest.conf" | ||
- "./.test/registered_nodes.txt:/root/.minetest/worlds/world/registered_nodes.txt" | ||
- "world:/root/.minetest/worlds/world" | ||
ports: | ||
- "30000:30000/udp" | ||
|
||
volumes: | ||
world: {} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,56 +1,12 @@ | ||
|
||
minetest.log("warning", "[technic] integration-test enabled!") | ||
-- check if all required nodenames are registered | ||
mtt.validate_nodenames(minetest.get_worldpath().."/registered_nodes.txt") | ||
|
||
-- those mods have to be present | ||
local assert_mods = { | ||
"technic", | ||
"pipeworks" | ||
} | ||
-- test mapgen | ||
mtt.emerge_area({x=0, y=0, z=0}, {x=48, y=48, z=48}) | ||
|
||
-- those nodes have to be present | ||
local assert_nodes = { | ||
"technic:admin_anchor" | ||
} | ||
|
||
-- defered integration test function | ||
minetest.register_on_mods_loaded(function() | ||
minetest.log("warning", "[technic] all mods loaded, starting delayed test-function") | ||
|
||
minetest.after(1, function() | ||
minetest.log("warning", "[technic] starting integration test") | ||
|
||
-- export stats | ||
local 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 | ||
|
||
-- check mods | ||
for _, modname in ipairs(assert_mods) do | ||
if not minetest.get_modpath(modname) then | ||
error("Mod not present: " .. modname) | ||
end | ||
end | ||
|
||
-- check nodes | ||
for _, nodename in ipairs(assert_nodes) do | ||
if not minetest.registered_nodes[nodename] then | ||
error("Node not present: " .. nodename) | ||
end | ||
end | ||
|
||
-- write success flag | ||
local data = minetest.write_json({ success = true }, true); | ||
file = io.open(minetest.get_worldpath().."/integration_test.json", "w" ); | ||
if file then | ||
file:write(data) | ||
file:close() | ||
end | ||
|
||
minetest.log("warning", "[technic] integration tests done!") | ||
minetest.request_shutdown("success") | ||
end) | ||
end) | ||
mtt.register("technic.max_lag", function(callback) | ||
local lag = technic.get_max_lag() | ||
assert(lag ~= nil and lag > 0) | ||
callback() | ||
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name = technic | ||
depends = default, pipeworks, technic_worldgen, basic_materials, moreores | ||
optional_depends = bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, vector_extras, dye, craftguide, i3 | ||
optional_depends = bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, vector_extras, dye, craftguide, i3, mtt |