mt-mods / technic

Technic mod for Minetest
18 stars 25 forks source link

Cleanup deprecated metadata access for tools #233

Closed S-S-X closed 2 years ago

S-S-X commented 3 years ago

Cleanup metadata access functions used by Technic power tools. See issue #114

Option 1, requires compatibility shims

~~Tools continue playing with manual wear and charge storage reads/writes, storage cannot be updated easily in future. Requires dirty workarounds if deprecated functions will be removed (still manual serialization and data storage in meta field with empty key).~~

Option 2, break compatibility (31abc4e)

For this PR option 2 requires at least allowing charge value input/output for technic.use_RE_charge. API proposal, tools never touch wear or charge values directly:

Testing

Notes

Compatibility

Merged Pull request Mod source file ContentDB
TODO (was already broken, see #236) technictrain Yes
Forum topic, requires repository technic_addons
technic_addons.zip
Yes
Full compatibility Emojigit/technic_grass_clean#2
Minimal compatibility Emojigit/technic_grass_clean#3
technic_grass_clean Yes
TODO moretechnictools No
Minimal compatibility: minetest-mods/mychisel#8
Full compatibility: minetest-mods/mychisel#9
mychisel No
TODO turtle No
Full compatibility https://github.com/berengma/antipest/pull/2
Minimal compatibility https://github.com/berengma/antipest/pull/1
antipest No
TODO (currently doesn't use technic, tool is disabled) water_life Yes
berengma/pocketnuke#3 pocketnuke No
TODO teletool Yes
✔️ Override included digtron Yes
✔️ Full compatibility berengma/farming_nextgen#18
Minimal compatibility berengma/farming_nextgen#19
farming_nextgen No
✔️ Minimal compatibility SwissalpS/replacer#31 replacer No
✔️ Full compatibility OgelGames/powerbanks#8 powerbanks Yes
✔️ Fork OgelGames/powerbanks X X

(linked just one file / repo, some repos contain more)

S-S-X commented 3 years ago

I bet existing tools wont be happy with update. Here's prospector that has both old and new metadata fields:

{
    [""] = "return {[\"look_radius\"] = \"3\", [\"target\"] = \"default:desert_cobble\", [\"look_depth\"] = \"21\", [\"charge\"] = 0}",
    look_radius = "3",
    look_depth = "21",
    charge = "163620",
    target = "default:desert_cobble"
}

I think this can be solved somehow but not sure about exact implementation. One possible solution could be to completely forget about charge and use only max_charge (static) with tool wear value. Currently charge value is accurate, using wear value makes it less accurate in some cases. Even that will still require migration for other fields but that's not something you'd like to do every use/charge/discharge cycle but instead during tool registration.

S-S-X commented 3 years ago

Actually even that (dropping charge) wont really help here as tools have been setting charge values by themselves, there was only partial API available and therefore data storage cannot be really changed without breaking compatibility.

This is not compatible with official Technic mod and also not compatible with tools provided by other mods because API function similar to added technic.use_RE_charge(itemstack, amount) was not available. Tools will keep setting metadata like before and checks for available energy simply wont work. Old style data can be accessed without using deprecated functions.

Question is do we want to go dirty way to keep compatibility or would it be better to really switch to current API and break compatibility?

I would vote for new API and break compatibility, other mods should anyway be updated to get rid of deprecation warnings so why not go forward and create API without dirty maximum compatibility workarounds. Would also fit well with upcoming release.

Related commit (Engine API documentation): https://github.com/minetest/minetest/commit/74b670a7930736fb4f43dcb5c9e0a366bf23cad4

OgelGames commented 3 years ago

I would vote for new API and break compatibility, other mods should anyway be updated to get rid of deprecation warnings so why not go forward and create API without dirty maximum compatibility workarounds.

Totally agree 👍 Other mods can just check for the new API functions, and use the old way if they don't exist.

We should also consider adding some version identifier to the technic namespace, to make it easier for other mods to distinguish between technic versions, something like technic.plus = true.

S-S-X commented 3 years ago

edit. moving contents to description

SwissalpS commented 3 years ago

I would vote for new API and break compatibility, other mods should anyway be updated to get rid of deprecation warnings so why not go forward and create API without dirty maximum compatibility workarounds. Would also fit well with upcoming release.

I agree with this.

S-S-X commented 3 years ago

We should also consider adding some version identifier to the technic namespace, to make it easier for other mods to distinguish between technic versions, something like technic.plus = true.

technic.plus sounds simple and good, this could also include version number. Might be useful to have technic.version too but technic.plus for sure is safer and simpler option if someone else got idea to also add technic.version.

SwissalpS commented 3 years ago

We should also consider adding some version identifier to the technic namespace, to make it easier for other mods to distinguish between technic versions, something like technic.plus = true.

technic.plus sounds simple and good, this could also include version number. Might be useful to have technic.version too but technic.plus for sure is safer and simpler option if someone else got idea to also add technic.version.

I like the name technic.plus (.version would work for me too). Would prefer a number rather than a boolean there. Something like an international date (20211104 today) would allow easy comparisons in additon to simple checks if existing.

S-S-X commented 3 years ago

I've been working on rewriting power tool registration to cleanup tools bit more, increase compatibility with old tools a bit and reduce footprint even more for new tools. Function technic.refill_RE_charge being simply wrapper is removed from public API, technic.set_RE_charge serves same purpose and more.

Basic description for upcoming update:

-technic.register_power_tool("technic:flashlight", 30000)

-minetest.register_tool("technic:flashlight", {
+technic.register_power_tool("technic:flashlight", {
        description = S("Flashlight"),
        inventory_image = "technic_flashlight.png",
-       stack_max = 1,
-       wear_represents = "technic_RE_charge",
-       on_refill = technic.refill_RE_charge,
+       max_charge = 30000,
 })

 minetest.register_craft({

Increased compatibility with old tools still wont allow skipping tool updates completely but allows minimal changes for tools, basically only this will be needed:

-           local meta = minetest.deserialize(itemstack:get_metadata())
+           local meta = technic.plus
+               and { charge = technic.get_RE_charge(itemstack) }
+               or minetest.deserialize(itemstack:get_metadata())
S-S-X commented 3 years ago

If digtron causes troubles with digtron.tap_batteries it might well be that it caches function pointer internally, I've noticed digtron doing a lot of caching like this for internal stuff.

If this happens then next options are either update digtron mod (unlikely even while it is already buggy also in this area) or fork it.

S-S-X commented 3 years ago

Added basic interaction integration tests with technic:multitool, just verifies that tool has certain fields after registration, BB can charge it and charge is used when player uses tool.

(this uses technic:solar_array_hv's instead of technic:hv_solar_array's for battery box charging which probably causes tests to fail when merged with #230 edit. actually tested and seems to be fine...)

S-S-X commented 3 years ago

Updated tests to include very basic API functions and simple custom tool registration test / custom tool play test.

S-S-X commented 3 years ago

Should we test compatibility stuff? No? When it breaks it just breaks. I believe it most probably is not good idea in long run but if you have idea why it would be useful then it is not complicated to add.

OgelGames commented 3 years ago

I did some testing (of tools, didn't test digtron), and everything seems to be working correctly, however I found one significant issue; tools that have been charged before this version don't function, despite looking like they have charge.

I think get_RE_charge should check and convert the old charge value:

function technic.get_RE_charge(stack)
    local meta = stack:get_meta()
    local charge = meta:get_int("charge")
    if charge == 0 then
        local old_meta = minetest.deserialize(meta:get(""))
        if old_meta then
            charge = old_meta.charge or 0
            meta:set_string("", "")
            meta:set_int("charge", charge)
        end
    end
    return charge
end
S-S-X commented 3 years ago

I did some testing (of tools, didn't test digtron), and everything seems to be working correctly, however I found one significant issue; tools that have been charged before this version don't function, despite looking like they have charge.

I think get_RE_charge should check and convert the old charge value:

function technic.get_RE_charge(stack)
  local meta = stack:get_meta()
  local charge = meta:get_int("charge")
  if charge == 0 then
      local old_meta = minetest.deserialize(meta:get(""))
      if old_meta then
          charge = old_meta.charge or 0
          meta:set_string("", "")
          meta:set_int("charge", charge)
      end
  end
  return charge
end

Yeah, that's known issue and I was not yet able to find good solution for it. While mostly harmless it is very confusing and should be fixed somehow. However I'd like to avoid doing that ^^ as much as possible...

Well, I've already tried to look if there's any way to reset old tools with some one shot operation that would work like LBM but so far that seems to be way too complicated. Maybe that's really only viable solution here... at least it could be added to compat and possibly allow disabling those with configuration. meta:set_string("", "") however should not be done because tools might use that metadata for other things (like prospector did and it will also lose configuration, leaves old data which is not nice but maybe still better to let tool decide what to do with old data).

OgelGames commented 3 years ago

Should we test compatibility stuff?

Well I tested powerbanks and it worked as intended, got warnings and nothing crashed.

at least it could be added to compat and possibly allow disabling those with configuration.

👍

meta:set_string("", "") however should not be done because tools might use that metadata for other things (like prospector did and it will also lose configuration, leaves old data which is not nice but maybe still better to let tool decide what to do with old data).

The old charge has to be cleared though, otherwise it will be infinite, so maybe this then:

old_meta.charge = nil
if next(old_meta) == nil then
    meta:set_string("", "")
else
    meta:set_string("", minetest.serialize(old_meta))
end

Also I noticed, use_RE_charge doesn't use get_RE_charge, so the tools using that function will still have the same problem.

S-S-X commented 3 years ago

Should we test compatibility stuff?

That question is more about automated testing. Like this but with old data / old registration that forces it through compatibility stuff https://github.com/mt-mods/technic/blob/efc03a297087c8fe4222fdb59d9c189328a92a73/technic/spec/tools_spec.lua#L83-L97

meta:set_string("", "") however should not be done because tools might use that metadata for other things (like prospector did and it will also lose configuration, leaves old data which is not nice but maybe still better to let tool decide what to do with old data).

The old charge has to be cleared though, otherwise it will be infinite, so maybe this then:

Yeah just charge removed and metadata pushed back. But still is there any other way...? Well... having version information on every tool would work but not sure... that also does not sound very good solution. It will prevent loop if tool happens to set charge again.

OgelGames commented 3 years ago

Should we test compatibility stuff?

That question is more about automated testing.

Ah, then no, that's probably not necessary.

But still is there any other way...?

The only other option is to let the tools handle it, which probably would be okay, as the problem only occurs with tools that have been updated to use the new API.

S-S-X commented 3 years ago

The only other option is to let the tools handle it, which probably would be okay, as the problem only occurs with tools that have been updated to use the new API.

One thing just came in to my mind, not sure if it is good idea or not but at very beginning of this PR I was looking for ways to drop charge from storage completely and only use tool wear. That would solve this issue completely and make it simpler, reason why I decided to not do that was accuracy of charge value but not sure how important that actually is. https://github.com/mt-mods/technic/pull/233#issuecomment-955770022 (and previous)

That would be nicest way to do it considering compatibility and seamless upgrade, like stated on original comment it would not make new API magically compatible with old tools but (inaccurate in some cases) charge data would survive.

Charge would be scaled (up or down) to 16bit range and this what causes lost accuracy. It should be overall simpler way to handle charge values, would losing some accuracy be acceptable? Thinking about it batteries in real life are far from accurate and consistent energy storage...

BuckarooBanzay commented 3 years ago

do i understand this correctly: this PR is replaced by #239, right? (this could be closed then?)

OgelGames commented 3 years ago

do i understand this correctly: this PR is replaced by #239, right? (this could be closed then?)

No, that PR is to drop the metadata charge value, and use the tool wear instead. (it will merge into this PR's branch)

S-S-X commented 3 years ago

do i understand this correctly: this PR is replaced by #239, right? (this could be closed then?)

No, that PR is to drop the metadata charge value, and use the tool wear instead. (it will merge into this PR's branch)

Currently situation here is:

Some tools will lose previous configuration (prospector mostly, if I remember correctly also drills mode is reset). Actual data is there but not used by tools anymore, old data is not removed ever unless toll is destroyed. Old data is stored in empty meta field meta:get("").

BuckarooBanzay commented 3 years ago

let me know if you need help testing this

S-S-X commented 3 years ago

I've added validation and default return value for technic.get_RE_charge so it will accept stack that is not technic power tool. Also similar for technic.set_RE_charge but instead of silently accepting it will log error about invalid stack.

While technic.get_RE_charge can be used to easily check if stack is power tool with charge technic.set_RE_charge on the other hand should never be used on stack that is not registered technic power tool. Logging error instead of crashing seems to be good way to communicate this and check itself is not expensive or complicated.

I should probably still go through code and see if there's some clear mistakes left around: mostly battery boxes.

S-S-X commented 3 years ago

This is somewhat interesting PR https://github.com/minetest/minetest/pull/11110 and might allow actually using wear calculated by engine for simple tools in future. Might not be possible as there's also other tool handling involved but there's a chance this would effectively allow removing wear calculations completely from simple tools without need to update API introduced in this PR.

S-S-X commented 3 years ago

Added pull requests for technic_grass_clean

S-S-X commented 2 years ago

Added pull request for pocketnuke:

github-actions[bot] commented 2 years ago
Mineunit failed regression tests, click for details ### Regression test log for Technic CNC: ``` ``` ### Regression test log for Technic Chests: ``` ``` ### Regression test log for Technic: ``` ✱●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●✱✱●●●●●●●●●●●●●●●●●●✱●●●●●◌●●●●●✱ 58 successes / 0 failures / 5 errors / 1 pending : 0.863051 seconds Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter Error → ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua @ 631 suite spec/api_spec.lua ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua:631: Too many arguments provided to core.translate Error → ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua @ 631 suite spec/hv_network_spec.lua ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua:631: Too many arguments provided to core.translate Error → ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua @ 631 suite spec/lv_network_spec.lua ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua:631: Too many arguments provided to core.translate Error → ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua @ 631 suite spec/nodes_spec.lua ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua:631: Too many arguments provided to core.translate Error → ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua @ 631 suite spec/tools_spec.lua ...rocks/share/lua/5.1/mineunit/common/misc_helpers.lua:631: Too many arguments provided to core.translate ```
S-S-X commented 2 years ago

Added PRs for mychisel

S-S-X commented 2 years ago

Added PRs for antipest:

S-S-X commented 2 years ago

@BuckarooBanzay can we test this on Pandorabox test server? Technic tool mods should be updated for testing, so far only few have already merged compatibility PRs.

These would require using fork for testing:

Already some time since other PRs merged but not sure about test server state... So these should be ready but must be up to date:

Was there other Technic power tools not included in Technic itself on Pandorabox?

Also added data migration for prospector. Bit better UX as that one actually stores some configuration data.

OgelGames commented 2 years ago

Was there other Technic power tools not included in Technic itself on Pandorabox?

Only headlamp I think, though that should work correctly (tested on the previous commit here).

S-S-X commented 2 years ago

Was there other Technic power tools not included in Technic itself on Pandorabox?

Only headlamp I think, though that should work correctly (tested on the previous commit here).

Did some basic testing with headlamp and it worked without problems, should be fine 👍

github-actions[bot] commented 2 years ago
Click for detailed source code test coverage report ### Test coverage report for Technic CNC 87.33% in 11/14 files: ``` File Hits Missed Coverage ----------------------------------------------------- programs.lua 263 0 100.00% materials/technic_worldgen.lua 32 0 100.00% materials/init.lua 14 0 100.00% materials/default.lua 183 0 100.00% materials/basic_materials.lua 17 0 100.00% init.lua 16 0 100.00% digilines.lua 55 0 100.00% cnc.lua 53 0 100.00% formspec.lua 104 7 93.69% api.lua 217 43 83.46% pipeworks.lua 25 13 65.79% materials/moreblocks.lua 0 29 0.00% materials/ethereal.lua 0 37 0.00% materials/bakedclay.lua 0 13 0.00% ``` ### Test coverage report for technic chests 45.56% in 6/6 files: ``` File Hits Missed Coverage ---------------------------------- chests.lua 102 18 85.00% init.lua 34 18 65.38% register.lua 84 78 51.85% formspec.lua 76 93 44.97% inventory.lua 10 100 9.09% digilines.lua 2 61 3.17% ``` ### Test coverage report for technic 62.04% in 96/96 files: ``` File Hits Missed Coverage -------------------------------------------------------------- max_lag.lua 12 0 100.00% machines/register/init.lua 15 0 100.00% machines/register/freezer_recipes.lua 13 0 100.00% machines/other/init.lua 8 0 100.00% machines/MV/solar_array.lua 12 0 100.00% machines/MV/init.lua 17 0 100.00% machines/MV/grinder.lua 17 0 100.00% machines/MV/generator.lua 9 0 100.00% machines/MV/freezer.lua 17 0 100.00% machines/MV/extractor.lua 17 0 100.00% machines/MV/electric_furnace.lua 17 0 100.00% machines/MV/compressor.lua 17 0 100.00% machines/MV/centrifuge.lua 17 0 100.00% machines/MV/cables.lua 40 0 100.00% machines/MV/battery_box.lua 17 0 100.00% machines/MV/alloy_furnace.lua 19 0 100.00% machines/LV/solar_array.lua 11 0 100.00% machines/LV/init.lua 17 0 100.00% machines/LV/grinder.lua 16 0 100.00% machines/LV/generator.lua 9 0 100.00% machines/LV/electric_furnace.lua 15 0 100.00% machines/LV/compressor.lua 20 0 100.00% machines/LV/cables.lua 40 0 100.00% machines/LV/battery_box.lua 15 0 100.00% machines/LV/alloy_furnace.lua 17 0 100.00% machines/HV/solar_array.lua 11 0 100.00% machines/HV/init.lua 12 0 100.00% machines/HV/grinder.lua 17 0 100.00% machines/HV/generator.lua 9 0 100.00% machines/HV/electric_furnace.lua 17 0 100.00% machines/HV/compressor.lua 17 0 100.00% machines/HV/cables.lua 39 0 100.00% machines/HV/battery_box.lua 17 0 100.00% legacy.lua 33 0 100.00% items.lua 107 0 100.00% crafts.lua 133 0 100.00% machines/LV/led.lua 73 1 98.65% config.lua 51 1 98.08% machines/register/compressor_recipes.lua 36 1 97.30% machines/LV/geothermal.lua 75 3 96.15% machines/register/cables.lua 96 4 96.00% machines/register/solar_array.lua 46 2 95.83% machines/LV/solar_panel.lua 42 2 95.45% machines/network.lua 397 22 94.75% machines/register/alloy_recipes.lua 40 3 93.02% tools/init.lua 13 1 92.86% machines/LV/water_mill.lua 67 6 91.78% init.lua 22 2 91.67% machines/register/grindings.lua 42 5 89.36% register.lua 25 3 89.29% machines/LV/lamp.lua 110 14 88.71% machines/register/grinder_recipes.lua 106 16 86.89% tools/flashlight.lua 64 13 83.12% util/throttle.lua 9 2 81.82% machines/register/battery_box.lua 227 52 81.36% machines/register/machine_base.lua 165 41 80.10% machines/LV/extractor.lua 18 5 78.26% machines/register/recipes.lua 62 20 75.61% machines/switching_station.lua 76 25 75.25% machines/register/centrifuge_recipes.lua 21 7 75.00% radiation.lua 262 89 74.64% effects.lua 5 2 71.43% machines/overload.lua 12 5 70.59% machines/MV/wind_mill.lua 46 22 67.65% machines/supply_converter.lua 95 46 67.38% machines/other/coal_furnace.lua 2 1 66.67% machines/other/injector.lua 72 39 64.86% machines/switching_station_globalstep.lua 39 22 63.93% tools/multimeter.lua 130 78 62.50% machines/MV/hydro_turbine.lua 43 26 62.32% machines/MV/tool_workshop.lua 56 34 62.22% machines/register/generator.lua 122 88 58.10% tools/cans.lua 53 48 52.48% machines/power_monitor.lua 40 38 51.28% machines/init.lua 56 54 50.91% tools/mining_lasers.lua 36 35 50.70% machines/other/coal_alloy_furnace.lua 63 63 50.00% machines/LV/music_player.lua 46 46 50.00% machines/other/constructor.lua 67 69 49.26% tools/tree_tap.lua 24 27 47.06% tools/vacuum.lua 16 20 44.44% machines/register/common.lua 50 64 43.86% machines/HV/forcefield.lua 103 155 39.92% helpers.lua 57 96 37.25% machines/HV/nuclear_reactor.lua 119 205 36.73% machines/HV/quarry.lua 122 245 33.24% tools/sonic_screwdriver.lua 16 33 32.65% machines/compat/api.lua 16 34 32.00% tools/chainsaw.lua 37 80 31.62% machines/other/frames.lua 184 445 29.25% machines/compat/tools.lua 5 13 27.78% tools/mining_drill.lua 65 195 25.00% machines/other/anchor.lua 14 74 15.91% tools/prospector.lua 14 99 12.39% machines/compat/digtron.lua 4 41 8.89% machines/register/extractor_recipes.lua 6 65 8.45% ``` ### Raw test runner output for geeks: CNC: ``` ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 31 successes / 0 failures / 0 errors / 0 pending : 0.59929 seconds ``` Chests: ``` W: Configuration: invalid key exclude_textures ●●●●● 5 successes / 0 failures / 0 errors / 0 pending : 0.044193 seconds ``` Technic: ``` ●◌◌●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●● 197 successes / 0 failures / 0 errors / 4 pending : 10.144236 seconds Pending → spec/api_spec.lua @ 133 Technic API Machine registration registers my_mod:my_battery spec/api_spec.lua:133: Battery box registration does not include all fields Pending → spec/api_spec.lua @ 190 Technic API Machine registration registers my_mod:machine_base spec/api_spec.lua:190: Base machine registration does not include all fields Pending → spec/api_spec.lua @ 285 Technic API internals technic.cables TBD, misleading name and should be updated spec/api_spec.lua:285: TBD technic.cables naming and need, see technic networks data for possible options Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter ```
S-S-X commented 2 years ago

Cleaned up commits. Previous: a4b00ec Metadata migration for prospector 09d898f Fix tool spec, mod loading was updated fd24d80 Interaction and API tests for power tools a2a4203 Drop charge value completely 0998183 Remove deprecated power tool functions 9026499 Digtron battery holder compatibility c29af5d Use ephemeral sounds for tools 408b6eb Cleanup deprecated metadata access for tools

To: 58373c2 Interaction and API tests for power tools 502bf9e Power tool compatibility shims 5f28b16 Use ephemeral sounds for tools 7206b8d Add power tool API, refactor existing tools

Maybe commit "5f28b16 Use ephemeral sounds for tools" is not needed, only kept it because that one is not exactly about power tool API but more generic stuff that just happens to be here...

Some latest stats for LoC against current master (ec3a52c):

BuckarooBanzay commented 2 years ago

@BuckarooBanzay can we test this on Pandorabox test server? Technic tool mods should be updated for testing, so far only few have already merged compatibility PRs.

These would require using fork for testing:

* powerbanks (can also ignore powerbanks for now)

Already some time since other PRs merged but not sure about test server state... So these should be ready but must be up to date:

* farming_nextgen

* replacer

Was there other Technic power tools not included in Technic itself on Pandorabox?

Also added data migration for prospector. Bit better UX as that one actually stores some configuration data.

Sorry for the delay, test-server is up and running with restore from 2022-03-16 02:00 UTC:

No errors on startup, haven't tested anything else yet. I'll update and test a few more open update-PR's when i have some more free-time :wink:

S-S-X commented 2 years ago

No errors on startup, haven't tested anything else yet. I'll update and test a few more open update-PR's when i have some more free-time 😉

I'll try to test this one later today so no need to worry about it. Will also try to advertise it a bit for some chat discussion if there's other people who'd be interested in some testing 🥼

S-S-X commented 2 years ago

Everything seemed to work, did not test all tools on pandorabox test server yet as I've been testing also on my own dev server. Mostly tested migration stuff verifying that few selected old tools work and wont be losing charge and are using charge correctly. Power banks worked as items but lost charge immediately when placed to world as nodes, did not test charging because of that as it would require setting charge manually and better to test after node meta things is fixed.

edit. SwissalpS told that "existing in-world bat-packs work fine, only newly placed ones are nerfed :)"

S-S-X commented 2 years ago

@OgelGames problem with power bank is that it is trying to use Technic power tool API on nodes: ERROR[Server]: technic.set_RE_charge item not registered as power tool:powerbanks:powerbank_mk1_node For node metadata it should simply be using its own metadata storage implementation instead of Technic power tool API.

Not really sure if that is exact problem or if it is just mistake using node name when item name should be used. At least it seems that node and item are different things: powerbanks:powerbank_mk1_node and powerbanks:powerbank_mk1

OgelGames commented 2 years ago

Not really sure if that is exact problem or if it is just mistake using node name when item name should be used. At least it seems that node and item are different things: powerbanks:powerbank_mk1_node and powerbanks:powerbank_mk1

Yep, I think that is the problem, I might have to change how the placing of powerbanks works... 🤔

github-actions[bot] commented 2 years ago
Click for detailed source code test coverage report ### Test coverage report for Technic CNC 87.33% in 11/14 files: ``` File Hits Missed Coverage ----------------------------------------------------- programs.lua 263 0 100.00% materials/technic_worldgen.lua 32 0 100.00% materials/init.lua 14 0 100.00% materials/default.lua 183 0 100.00% materials/basic_materials.lua 17 0 100.00% init.lua 16 0 100.00% digilines.lua 55 0 100.00% cnc.lua 53 0 100.00% formspec.lua 104 7 93.69% api.lua 217 43 83.46% pipeworks.lua 25 13 65.79% materials/moreblocks.lua 0 29 0.00% materials/ethereal.lua 0 37 0.00% materials/bakedclay.lua 0 13 0.00% ``` ### Test coverage report for technic chests 45.56% in 6/6 files: ``` File Hits Missed Coverage ---------------------------------- chests.lua 102 18 85.00% init.lua 34 18 65.38% register.lua 84 78 51.85% formspec.lua 76 93 44.97% inventory.lua 10 100 9.09% digilines.lua 2 61 3.17% ``` ### Test coverage report for technic 62.03% in 96/96 files: ``` File Hits Missed Coverage -------------------------------------------------------------- max_lag.lua 12 0 100.00% machines/register/init.lua 15 0 100.00% machines/register/freezer_recipes.lua 13 0 100.00% machines/other/init.lua 8 0 100.00% machines/MV/solar_array.lua 12 0 100.00% machines/MV/init.lua 17 0 100.00% machines/MV/grinder.lua 17 0 100.00% machines/MV/generator.lua 9 0 100.00% machines/MV/freezer.lua 17 0 100.00% machines/MV/extractor.lua 17 0 100.00% machines/MV/electric_furnace.lua 17 0 100.00% machines/MV/compressor.lua 17 0 100.00% machines/MV/centrifuge.lua 17 0 100.00% machines/MV/cables.lua 40 0 100.00% machines/MV/battery_box.lua 17 0 100.00% machines/MV/alloy_furnace.lua 19 0 100.00% machines/LV/solar_array.lua 11 0 100.00% machines/LV/init.lua 17 0 100.00% machines/LV/grinder.lua 16 0 100.00% machines/LV/generator.lua 9 0 100.00% machines/LV/electric_furnace.lua 15 0 100.00% machines/LV/compressor.lua 20 0 100.00% machines/LV/cables.lua 40 0 100.00% machines/LV/battery_box.lua 15 0 100.00% machines/LV/alloy_furnace.lua 17 0 100.00% machines/HV/solar_array.lua 11 0 100.00% machines/HV/init.lua 12 0 100.00% machines/HV/grinder.lua 17 0 100.00% machines/HV/generator.lua 9 0 100.00% machines/HV/electric_furnace.lua 17 0 100.00% machines/HV/compressor.lua 17 0 100.00% machines/HV/cables.lua 39 0 100.00% machines/HV/battery_box.lua 17 0 100.00% legacy.lua 33 0 100.00% items.lua 107 0 100.00% crafts.lua 133 0 100.00% machines/LV/led.lua 73 1 98.65% config.lua 51 1 98.08% machines/register/compressor_recipes.lua 36 1 97.30% machines/LV/geothermal.lua 75 3 96.15% machines/register/cables.lua 96 4 96.00% machines/register/solar_array.lua 46 2 95.83% machines/LV/solar_panel.lua 42 2 95.45% machines/network.lua 397 22 94.75% machines/register/alloy_recipes.lua 40 3 93.02% tools/init.lua 13 1 92.86% machines/LV/water_mill.lua 67 6 91.78% init.lua 22 2 91.67% register.lua 26 3 89.66% machines/register/grindings.lua 42 5 89.36% machines/LV/lamp.lua 110 14 88.71% machines/register/grinder_recipes.lua 106 16 86.89% tools/flashlight.lua 64 13 83.12% util/throttle.lua 9 2 81.82% machines/register/battery_box.lua 227 52 81.36% machines/register/machine_base.lua 165 41 80.10% machines/LV/extractor.lua 18 5 78.26% machines/register/recipes.lua 62 20 75.61% machines/switching_station.lua 76 25 75.25% machines/register/centrifuge_recipes.lua 21 7 75.00% radiation.lua 262 89 74.64% effects.lua 5 2 71.43% machines/overload.lua 12 5 70.59% machines/MV/wind_mill.lua 46 22 67.65% machines/supply_converter.lua 95 46 67.38% machines/other/coal_furnace.lua 2 1 66.67% machines/other/injector.lua 72 39 64.86% machines/switching_station_globalstep.lua 39 22 63.93% tools/multimeter.lua 130 78 62.50% machines/MV/hydro_turbine.lua 43 26 62.32% machines/MV/tool_workshop.lua 56 34 62.22% machines/register/generator.lua 122 88 58.10% tools/cans.lua 53 48 52.48% machines/power_monitor.lua 40 38 51.28% machines/init.lua 56 54 50.91% tools/mining_lasers.lua 36 35 50.70% machines/other/coal_alloy_furnace.lua 63 63 50.00% machines/LV/music_player.lua 46 46 50.00% machines/other/constructor.lua 67 69 49.26% tools/tree_tap.lua 24 27 47.06% tools/vacuum.lua 16 20 44.44% machines/register/common.lua 50 64 43.86% machines/HV/forcefield.lua 103 155 39.92% helpers.lua 57 97 37.01% machines/HV/nuclear_reactor.lua 119 205 36.73% machines/HV/quarry.lua 122 245 33.24% tools/sonic_screwdriver.lua 16 33 32.65% machines/compat/api.lua 16 34 32.00% tools/chainsaw.lua 37 80 31.62% machines/other/frames.lua 184 445 29.25% machines/compat/tools.lua 5 13 27.78% tools/mining_drill.lua 65 195 25.00% machines/other/anchor.lua 14 74 15.91% tools/prospector.lua 14 99 12.39% machines/compat/digtron.lua 4 41 8.89% machines/register/extractor_recipes.lua 6 65 8.45% ``` ### Raw test runner output for geeks: CNC: ``` ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 31 successes / 0 failures / 0 errors / 0 pending : 0.531635 seconds ``` Chests: ``` W: Configuration: invalid key exclude_textures ●●●●● 5 successes / 0 failures / 0 errors / 0 pending : 0.035247 seconds ``` Technic: ``` ●◌◌●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●● 197 successes / 0 failures / 0 errors / 4 pending : 8.820792 seconds Pending → spec/api_spec.lua @ 133 Technic API Machine registration registers my_mod:my_battery spec/api_spec.lua:133: Battery box registration does not include all fields Pending → spec/api_spec.lua @ 190 Technic API Machine registration registers my_mod:machine_base spec/api_spec.lua:190: Base machine registration does not include all fields Pending → spec/api_spec.lua @ 285 Technic API internals technic.cables TBD, misleading name and should be updated spec/api_spec.lua:285: TBD technic.cables naming and need, see technic networks data for possible options Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter ```
github-actions[bot] commented 2 years ago
Click for detailed source code test coverage report ### Test coverage report for Technic CNC 87.33% in 11/14 files: ``` File Hits Missed Coverage ----------------------------------------------------- programs.lua 263 0 100.00% materials/technic_worldgen.lua 32 0 100.00% materials/init.lua 14 0 100.00% materials/default.lua 183 0 100.00% materials/basic_materials.lua 17 0 100.00% init.lua 16 0 100.00% digilines.lua 55 0 100.00% cnc.lua 53 0 100.00% formspec.lua 104 7 93.69% api.lua 217 43 83.46% pipeworks.lua 25 13 65.79% materials/moreblocks.lua 0 29 0.00% materials/ethereal.lua 0 37 0.00% materials/bakedclay.lua 0 13 0.00% ``` ### Test coverage report for technic chests 45.56% in 6/6 files: ``` File Hits Missed Coverage ---------------------------------- chests.lua 102 18 85.00% init.lua 34 18 65.38% register.lua 84 78 51.85% formspec.lua 76 93 44.97% inventory.lua 10 100 9.09% digilines.lua 2 61 3.17% ``` ### Test coverage report for technic 62.03% in 96/96 files: ``` File Hits Missed Coverage -------------------------------------------------------------- max_lag.lua 12 0 100.00% machines/register/init.lua 15 0 100.00% machines/register/freezer_recipes.lua 13 0 100.00% machines/other/init.lua 8 0 100.00% machines/MV/solar_array.lua 12 0 100.00% machines/MV/init.lua 17 0 100.00% machines/MV/grinder.lua 17 0 100.00% machines/MV/generator.lua 9 0 100.00% machines/MV/freezer.lua 17 0 100.00% machines/MV/extractor.lua 17 0 100.00% machines/MV/electric_furnace.lua 17 0 100.00% machines/MV/compressor.lua 17 0 100.00% machines/MV/centrifuge.lua 17 0 100.00% machines/MV/cables.lua 40 0 100.00% machines/MV/battery_box.lua 17 0 100.00% machines/MV/alloy_furnace.lua 19 0 100.00% machines/LV/solar_array.lua 11 0 100.00% machines/LV/init.lua 17 0 100.00% machines/LV/grinder.lua 16 0 100.00% machines/LV/generator.lua 9 0 100.00% machines/LV/electric_furnace.lua 15 0 100.00% machines/LV/compressor.lua 20 0 100.00% machines/LV/cables.lua 40 0 100.00% machines/LV/battery_box.lua 15 0 100.00% machines/LV/alloy_furnace.lua 17 0 100.00% machines/HV/solar_array.lua 11 0 100.00% machines/HV/init.lua 12 0 100.00% machines/HV/grinder.lua 17 0 100.00% machines/HV/generator.lua 9 0 100.00% machines/HV/electric_furnace.lua 17 0 100.00% machines/HV/compressor.lua 17 0 100.00% machines/HV/cables.lua 39 0 100.00% machines/HV/battery_box.lua 17 0 100.00% legacy.lua 33 0 100.00% items.lua 107 0 100.00% crafts.lua 133 0 100.00% machines/LV/led.lua 73 1 98.65% config.lua 51 1 98.08% machines/register/compressor_recipes.lua 36 1 97.30% machines/LV/geothermal.lua 75 3 96.15% machines/register/cables.lua 96 4 96.00% machines/register/solar_array.lua 46 2 95.83% machines/LV/solar_panel.lua 42 2 95.45% machines/network.lua 397 22 94.75% machines/register/alloy_recipes.lua 40 3 93.02% tools/init.lua 13 1 92.86% machines/LV/water_mill.lua 67 6 91.78% init.lua 22 2 91.67% register.lua 26 3 89.66% machines/register/grindings.lua 42 5 89.36% machines/LV/lamp.lua 110 14 88.71% machines/register/grinder_recipes.lua 106 16 86.89% tools/flashlight.lua 64 13 83.12% util/throttle.lua 9 2 81.82% machines/register/battery_box.lua 227 52 81.36% machines/register/machine_base.lua 165 41 80.10% machines/LV/extractor.lua 18 5 78.26% machines/register/recipes.lua 62 20 75.61% machines/switching_station.lua 76 25 75.25% machines/register/centrifuge_recipes.lua 21 7 75.00% radiation.lua 262 89 74.64% effects.lua 5 2 71.43% machines/overload.lua 12 5 70.59% machines/MV/wind_mill.lua 46 22 67.65% machines/supply_converter.lua 95 46 67.38% machines/other/coal_furnace.lua 2 1 66.67% machines/other/injector.lua 72 39 64.86% machines/switching_station_globalstep.lua 39 22 63.93% tools/multimeter.lua 130 78 62.50% machines/MV/hydro_turbine.lua 43 26 62.32% machines/MV/tool_workshop.lua 56 34 62.22% machines/register/generator.lua 122 88 58.10% tools/cans.lua 53 48 52.48% machines/power_monitor.lua 40 38 51.28% machines/init.lua 56 54 50.91% tools/mining_lasers.lua 36 35 50.70% machines/other/coal_alloy_furnace.lua 63 63 50.00% machines/LV/music_player.lua 46 46 50.00% machines/other/constructor.lua 67 69 49.26% tools/tree_tap.lua 24 27 47.06% tools/vacuum.lua 16 20 44.44% machines/register/common.lua 50 64 43.86% machines/HV/forcefield.lua 103 155 39.92% helpers.lua 57 97 37.01% machines/HV/nuclear_reactor.lua 119 205 36.73% machines/HV/quarry.lua 122 245 33.24% tools/sonic_screwdriver.lua 16 33 32.65% machines/compat/api.lua 16 34 32.00% tools/chainsaw.lua 37 80 31.62% machines/other/frames.lua 184 445 29.25% machines/compat/tools.lua 5 13 27.78% tools/mining_drill.lua 65 195 25.00% machines/other/anchor.lua 14 74 15.91% tools/prospector.lua 14 99 12.39% machines/compat/digtron.lua 4 41 8.89% machines/register/extractor_recipes.lua 6 65 8.45% ``` ### Raw test runner output for geeks: CNC: ``` ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 31 successes / 0 failures / 0 errors / 0 pending : 0.539543 seconds ``` Chests: ``` W: Configuration: invalid key exclude_textures ●●●●● 5 successes / 0 failures / 0 errors / 0 pending : 0.037892 seconds ``` Technic: ``` ●◌◌●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●● 197 successes / 0 failures / 0 errors / 4 pending : 9.409766 seconds Pending → spec/api_spec.lua @ 133 Technic API Machine registration registers my_mod:my_battery spec/api_spec.lua:133: Battery box registration does not include all fields Pending → spec/api_spec.lua @ 190 Technic API Machine registration registers my_mod:machine_base spec/api_spec.lua:190: Base machine registration does not include all fields Pending → spec/api_spec.lua @ 285 Technic API internals technic.cables TBD, misleading name and should be updated spec/api_spec.lua:285: TBD technic.cables naming and need, see technic networks data for possible options Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter ```
github-actions[bot] commented 2 years ago
Click for detailed source code test coverage report ### Test coverage report for Technic CNC 87.33% in 11/14 files: ``` File Hits Missed Coverage ----------------------------------------------------- programs.lua 263 0 100.00% materials/technic_worldgen.lua 32 0 100.00% materials/init.lua 14 0 100.00% materials/default.lua 183 0 100.00% materials/basic_materials.lua 17 0 100.00% init.lua 16 0 100.00% digilines.lua 55 0 100.00% cnc.lua 53 0 100.00% formspec.lua 104 7 93.69% api.lua 217 43 83.46% pipeworks.lua 25 13 65.79% materials/moreblocks.lua 0 29 0.00% materials/ethereal.lua 0 37 0.00% materials/bakedclay.lua 0 13 0.00% ``` ### Test coverage report for technic chests 45.56% in 6/6 files: ``` File Hits Missed Coverage ---------------------------------- chests.lua 102 18 85.00% init.lua 34 18 65.38% register.lua 84 78 51.85% formspec.lua 76 93 44.97% inventory.lua 10 100 9.09% digilines.lua 2 61 3.17% ``` ### Test coverage report for technic 62.03% in 96/96 files: ``` File Hits Missed Coverage -------------------------------------------------------------- max_lag.lua 12 0 100.00% machines/register/init.lua 15 0 100.00% machines/register/freezer_recipes.lua 13 0 100.00% machines/other/init.lua 8 0 100.00% machines/MV/solar_array.lua 12 0 100.00% machines/MV/init.lua 17 0 100.00% machines/MV/grinder.lua 17 0 100.00% machines/MV/generator.lua 9 0 100.00% machines/MV/freezer.lua 17 0 100.00% machines/MV/extractor.lua 17 0 100.00% machines/MV/electric_furnace.lua 17 0 100.00% machines/MV/compressor.lua 17 0 100.00% machines/MV/centrifuge.lua 17 0 100.00% machines/MV/cables.lua 40 0 100.00% machines/MV/battery_box.lua 17 0 100.00% machines/MV/alloy_furnace.lua 19 0 100.00% machines/LV/solar_array.lua 11 0 100.00% machines/LV/init.lua 17 0 100.00% machines/LV/grinder.lua 16 0 100.00% machines/LV/generator.lua 9 0 100.00% machines/LV/electric_furnace.lua 15 0 100.00% machines/LV/compressor.lua 20 0 100.00% machines/LV/cables.lua 40 0 100.00% machines/LV/battery_box.lua 15 0 100.00% machines/LV/alloy_furnace.lua 17 0 100.00% machines/HV/solar_array.lua 11 0 100.00% machines/HV/init.lua 12 0 100.00% machines/HV/grinder.lua 17 0 100.00% machines/HV/generator.lua 9 0 100.00% machines/HV/electric_furnace.lua 17 0 100.00% machines/HV/compressor.lua 17 0 100.00% machines/HV/cables.lua 39 0 100.00% machines/HV/battery_box.lua 17 0 100.00% legacy.lua 33 0 100.00% items.lua 107 0 100.00% crafts.lua 133 0 100.00% machines/LV/led.lua 73 1 98.65% config.lua 51 1 98.08% machines/register/compressor_recipes.lua 36 1 97.30% machines/LV/geothermal.lua 75 3 96.15% machines/register/cables.lua 96 4 96.00% machines/register/solar_array.lua 46 2 95.83% machines/LV/solar_panel.lua 42 2 95.45% machines/network.lua 397 22 94.75% machines/register/alloy_recipes.lua 40 3 93.02% tools/init.lua 13 1 92.86% machines/LV/water_mill.lua 67 6 91.78% init.lua 22 2 91.67% register.lua 26 3 89.66% machines/register/grindings.lua 42 5 89.36% machines/LV/lamp.lua 110 14 88.71% machines/register/grinder_recipes.lua 106 16 86.89% tools/flashlight.lua 64 13 83.12% util/throttle.lua 9 2 81.82% machines/register/battery_box.lua 227 52 81.36% machines/register/machine_base.lua 165 41 80.10% machines/LV/extractor.lua 18 5 78.26% machines/register/recipes.lua 62 20 75.61% machines/switching_station.lua 76 25 75.25% machines/register/centrifuge_recipes.lua 21 7 75.00% radiation.lua 262 89 74.64% effects.lua 5 2 71.43% machines/overload.lua 12 5 70.59% machines/MV/wind_mill.lua 46 22 67.65% machines/supply_converter.lua 95 46 67.38% machines/other/coal_furnace.lua 2 1 66.67% machines/other/injector.lua 72 39 64.86% machines/switching_station_globalstep.lua 39 22 63.93% tools/multimeter.lua 130 78 62.50% machines/MV/hydro_turbine.lua 43 26 62.32% machines/MV/tool_workshop.lua 56 34 62.22% machines/register/generator.lua 122 88 58.10% tools/cans.lua 53 48 52.48% machines/power_monitor.lua 40 38 51.28% machines/init.lua 56 54 50.91% tools/mining_lasers.lua 36 35 50.70% machines/other/coal_alloy_furnace.lua 63 63 50.00% machines/LV/music_player.lua 46 46 50.00% machines/other/constructor.lua 67 69 49.26% tools/tree_tap.lua 24 27 47.06% tools/vacuum.lua 16 20 44.44% machines/register/common.lua 50 64 43.86% machines/HV/forcefield.lua 103 155 39.92% helpers.lua 57 97 37.01% machines/HV/nuclear_reactor.lua 119 205 36.73% machines/HV/quarry.lua 122 245 33.24% tools/sonic_screwdriver.lua 16 33 32.65% machines/compat/api.lua 16 34 32.00% tools/chainsaw.lua 37 80 31.62% machines/other/frames.lua 184 445 29.25% machines/compat/tools.lua 5 13 27.78% tools/mining_drill.lua 65 195 25.00% machines/other/anchor.lua 14 74 15.91% tools/prospector.lua 14 99 12.39% machines/compat/digtron.lua 4 41 8.89% machines/register/extractor_recipes.lua 6 65 8.45% ``` ### Raw test runner output for geeks: CNC: ``` ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 31 successes / 0 failures / 0 errors / 0 pending : 0.503587 seconds ``` Chests: ``` W: Configuration: invalid key exclude_textures ●●●●● 5 successes / 0 failures / 0 errors / 0 pending : 0.035039 seconds ``` Technic: ``` ●◌◌●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●● 197 successes / 0 failures / 0 errors / 4 pending : 8.685678 seconds Pending → spec/api_spec.lua @ 133 Technic API Machine registration registers my_mod:my_battery spec/api_spec.lua:133: Battery box registration does not include all fields Pending → spec/api_spec.lua @ 190 Technic API Machine registration registers my_mod:machine_base spec/api_spec.lua:190: Base machine registration does not include all fields Pending → spec/api_spec.lua @ 285 Technic API internals technic.cables TBD, misleading name and should be updated spec/api_spec.lua:285: TBD technic.cables naming and need, see technic networks data for possible options Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter ```
S-S-X commented 2 years ago

Will merge this soon to get clean table for future things, waiting for some time but this has been tested since... I don't know anymore.. but probably gone through more testing than any PR before merge so far and with a many testers too.

I'll add some quick fix for power banks through fork + additional pr first if not updated by then. After that will be updating other mods if needed (and perma-forking those if that's what it takes).

github-actions[bot] commented 2 years ago
Click for detailed source code test coverage report ### Test coverage report for Technic CNC 87.33% in 11/14 files: ``` File Hits Missed Coverage ----------------------------------------------------- programs.lua 263 0 100.00% materials/technic_worldgen.lua 32 0 100.00% materials/init.lua 14 0 100.00% materials/default.lua 183 0 100.00% materials/basic_materials.lua 17 0 100.00% init.lua 16 0 100.00% digilines.lua 55 0 100.00% cnc.lua 53 0 100.00% formspec.lua 104 7 93.69% api.lua 217 43 83.46% pipeworks.lua 25 13 65.79% materials/moreblocks.lua 0 29 0.00% materials/ethereal.lua 0 37 0.00% materials/bakedclay.lua 0 13 0.00% ``` ### Test coverage report for technic chests 45.56% in 6/6 files: ``` File Hits Missed Coverage ---------------------------------- chests.lua 102 18 85.00% init.lua 34 18 65.38% register.lua 84 78 51.85% formspec.lua 76 93 44.97% inventory.lua 10 100 9.09% digilines.lua 2 61 3.17% ``` ### Test coverage report for technic 62.07% in 96/96 files: ``` File Hits Missed Coverage -------------------------------------------------------------- max_lag.lua 12 0 100.00% machines/register/init.lua 15 0 100.00% machines/register/freezer_recipes.lua 13 0 100.00% machines/other/init.lua 8 0 100.00% machines/MV/solar_array.lua 12 0 100.00% machines/MV/init.lua 17 0 100.00% machines/MV/grinder.lua 17 0 100.00% machines/MV/generator.lua 9 0 100.00% machines/MV/freezer.lua 17 0 100.00% machines/MV/extractor.lua 17 0 100.00% machines/MV/electric_furnace.lua 17 0 100.00% machines/MV/compressor.lua 17 0 100.00% machines/MV/centrifuge.lua 17 0 100.00% machines/MV/cables.lua 40 0 100.00% machines/MV/battery_box.lua 17 0 100.00% machines/MV/alloy_furnace.lua 19 0 100.00% machines/LV/solar_array.lua 11 0 100.00% machines/LV/init.lua 17 0 100.00% machines/LV/grinder.lua 16 0 100.00% machines/LV/generator.lua 9 0 100.00% machines/LV/electric_furnace.lua 15 0 100.00% machines/LV/compressor.lua 20 0 100.00% machines/LV/cables.lua 40 0 100.00% machines/LV/battery_box.lua 15 0 100.00% machines/LV/alloy_furnace.lua 17 0 100.00% machines/HV/solar_array.lua 11 0 100.00% machines/HV/init.lua 12 0 100.00% machines/HV/grinder.lua 17 0 100.00% machines/HV/generator.lua 9 0 100.00% machines/HV/electric_furnace.lua 17 0 100.00% machines/HV/compressor.lua 17 0 100.00% machines/HV/cables.lua 39 0 100.00% machines/HV/battery_box.lua 17 0 100.00% legacy.lua 33 0 100.00% items.lua 107 0 100.00% crafts.lua 133 0 100.00% machines/LV/led.lua 73 1 98.65% config.lua 51 1 98.08% machines/register/compressor_recipes.lua 36 1 97.30% machines/LV/geothermal.lua 75 3 96.15% machines/register/cables.lua 96 4 96.00% machines/register/solar_array.lua 46 2 95.83% machines/network.lua 404 19 95.51% machines/LV/solar_panel.lua 42 2 95.45% machines/register/alloy_recipes.lua 40 3 93.02% tools/init.lua 13 1 92.86% machines/LV/water_mill.lua 67 6 91.78% init.lua 22 2 91.67% register.lua 26 3 89.66% machines/register/grindings.lua 42 5 89.36% machines/LV/lamp.lua 110 14 88.71% machines/register/grinder_recipes.lua 106 16 86.89% tools/flashlight.lua 64 13 83.12% util/throttle.lua 9 2 81.82% machines/register/battery_box.lua 227 52 81.36% machines/register/machine_base.lua 165 41 80.10% machines/LV/extractor.lua 18 5 78.26% machines/register/recipes.lua 62 20 75.61% machines/register/centrifuge_recipes.lua 21 7 75.00% radiation.lua 262 89 74.64% machines/switching_station.lua 80 32 71.43% effects.lua 5 2 71.43% machines/overload.lua 12 5 70.59% machines/MV/wind_mill.lua 46 22 67.65% machines/supply_converter.lua 95 46 67.38% machines/other/coal_furnace.lua 2 1 66.67% machines/switching_station_globalstep.lua 31 16 65.96% machines/other/injector.lua 72 39 64.86% tools/multimeter.lua 130 78 62.50% machines/MV/hydro_turbine.lua 43 26 62.32% machines/MV/tool_workshop.lua 56 34 62.22% machines/register/generator.lua 122 88 58.10% tools/cans.lua 53 48 52.48% machines/power_monitor.lua 40 38 51.28% machines/init.lua 56 54 50.91% tools/mining_lasers.lua 36 35 50.70% machines/other/coal_alloy_furnace.lua 63 63 50.00% machines/LV/music_player.lua 46 46 50.00% machines/other/constructor.lua 67 69 49.26% tools/tree_tap.lua 24 27 47.06% tools/vacuum.lua 16 20 44.44% machines/register/common.lua 50 64 43.86% machines/HV/forcefield.lua 103 155 39.92% helpers.lua 57 97 37.01% machines/HV/nuclear_reactor.lua 119 205 36.73% machines/HV/quarry.lua 122 245 33.24% tools/sonic_screwdriver.lua 16 33 32.65% machines/compat/api.lua 16 34 32.00% tools/chainsaw.lua 37 80 31.62% machines/other/frames.lua 184 445 29.25% machines/compat/tools.lua 5 13 27.78% tools/mining_drill.lua 65 195 25.00% machines/other/anchor.lua 14 74 15.91% tools/prospector.lua 14 99 12.39% machines/compat/digtron.lua 4 41 8.89% machines/register/extractor_recipes.lua 6 65 8.45% ``` ### Raw test runner output for geeks: CNC: ``` ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 31 successes / 0 failures / 0 errors / 0 pending : 0.500946 seconds ``` Chests: ``` W: Configuration: invalid key exclude_textures ●●●●● 5 successes / 0 failures / 0 errors / 0 pending : 0.034318 seconds ``` Technic: ``` ●◌◌●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●● 197 successes / 0 failures / 0 errors / 4 pending : 8.625194 seconds Pending → spec/api_spec.lua @ 133 Technic API Machine registration registers my_mod:my_battery spec/api_spec.lua:133: Battery box registration does not include all fields Pending → spec/api_spec.lua @ 190 Technic API Machine registration registers my_mod:machine_base spec/api_spec.lua:190: Base machine registration does not include all fields Pending → spec/api_spec.lua @ 285 Technic API internals technic.cables TBD, misleading name and should be updated spec/api_spec.lua:285: TBD technic.cables naming and need, see technic networks data for possible options Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter ```
github-actions[bot] commented 2 years ago
Click for detailed source code test coverage report ### Test coverage report for Technic CNC 87.33% in 11/14 files: ``` File Hits Missed Coverage ----------------------------------------------------- programs.lua 263 0 100.00% materials/technic_worldgen.lua 32 0 100.00% materials/init.lua 14 0 100.00% materials/default.lua 183 0 100.00% materials/basic_materials.lua 17 0 100.00% init.lua 16 0 100.00% digilines.lua 55 0 100.00% cnc.lua 53 0 100.00% formspec.lua 104 7 93.69% api.lua 217 43 83.46% pipeworks.lua 25 13 65.79% materials/moreblocks.lua 0 29 0.00% materials/ethereal.lua 0 37 0.00% materials/bakedclay.lua 0 13 0.00% ``` ### Test coverage report for technic chests 45.56% in 6/6 files: ``` File Hits Missed Coverage ---------------------------------- chests.lua 102 18 85.00% init.lua 34 18 65.38% register.lua 84 78 51.85% formspec.lua 76 93 44.97% inventory.lua 10 100 9.09% digilines.lua 2 61 3.17% ``` ### Test coverage report for technic 62.04% in 96/96 files: ``` File Hits Missed Coverage -------------------------------------------------------------- max_lag.lua 12 0 100.00% machines/register/init.lua 15 0 100.00% machines/register/freezer_recipes.lua 13 0 100.00% machines/other/init.lua 8 0 100.00% machines/MV/solar_array.lua 12 0 100.00% machines/MV/init.lua 17 0 100.00% machines/MV/grinder.lua 17 0 100.00% machines/MV/generator.lua 9 0 100.00% machines/MV/freezer.lua 17 0 100.00% machines/MV/extractor.lua 17 0 100.00% machines/MV/electric_furnace.lua 17 0 100.00% machines/MV/compressor.lua 17 0 100.00% machines/MV/centrifuge.lua 17 0 100.00% machines/MV/cables.lua 40 0 100.00% machines/MV/battery_box.lua 17 0 100.00% machines/MV/alloy_furnace.lua 19 0 100.00% machines/LV/solar_array.lua 11 0 100.00% machines/LV/init.lua 17 0 100.00% machines/LV/grinder.lua 16 0 100.00% machines/LV/generator.lua 9 0 100.00% machines/LV/electric_furnace.lua 15 0 100.00% machines/LV/compressor.lua 20 0 100.00% machines/LV/cables.lua 40 0 100.00% machines/LV/battery_box.lua 15 0 100.00% machines/LV/alloy_furnace.lua 17 0 100.00% machines/HV/solar_array.lua 11 0 100.00% machines/HV/init.lua 12 0 100.00% machines/HV/grinder.lua 17 0 100.00% machines/HV/generator.lua 9 0 100.00% machines/HV/electric_furnace.lua 17 0 100.00% machines/HV/compressor.lua 17 0 100.00% machines/HV/cables.lua 39 0 100.00% machines/HV/battery_box.lua 17 0 100.00% legacy.lua 33 0 100.00% items.lua 107 0 100.00% crafts.lua 133 0 100.00% machines/LV/led.lua 73 1 98.65% config.lua 51 1 98.08% machines/register/compressor_recipes.lua 36 1 97.30% machines/LV/geothermal.lua 75 3 96.15% machines/register/cables.lua 96 4 96.00% machines/register/solar_array.lua 46 2 95.83% machines/network.lua 404 19 95.51% machines/LV/solar_panel.lua 42 2 95.45% machines/register/alloy_recipes.lua 40 3 93.02% tools/init.lua 13 1 92.86% machines/LV/water_mill.lua 67 6 91.78% init.lua 22 2 91.67% register.lua 26 3 89.66% machines/LV/lamp.lua 111 13 89.52% machines/register/grindings.lua 42 5 89.36% machines/register/grinder_recipes.lua 106 16 86.89% tools/flashlight.lua 64 13 83.12% util/throttle.lua 9 2 81.82% machines/register/battery_box.lua 227 52 81.36% machines/register/machine_base.lua 165 41 80.10% machines/LV/extractor.lua 18 5 78.26% machines/register/recipes.lua 62 20 75.61% machines/register/centrifuge_recipes.lua 21 7 75.00% radiation.lua 262 89 74.64% machines/switching_station.lua 80 32 71.43% effects.lua 5 2 71.43% machines/overload.lua 12 5 70.59% machines/MV/wind_mill.lua 46 22 67.65% machines/supply_converter.lua 95 46 67.38% machines/other/coal_furnace.lua 2 1 66.67% machines/switching_station_globalstep.lua 31 16 65.96% machines/other/injector.lua 72 39 64.86% tools/multimeter.lua 130 78 62.50% machines/MV/hydro_turbine.lua 43 26 62.32% machines/MV/tool_workshop.lua 56 34 62.22% machines/register/generator.lua 122 88 58.10% tools/cans.lua 53 48 52.48% machines/power_monitor.lua 40 38 51.28% machines/init.lua 56 54 50.91% tools/mining_lasers.lua 36 35 50.70% machines/other/coal_alloy_furnace.lua 63 63 50.00% machines/LV/music_player.lua 46 46 50.00% machines/other/constructor.lua 67 69 49.26% tools/tree_tap.lua 24 27 47.06% tools/vacuum.lua 16 20 44.44% machines/register/common.lua 50 64 43.86% machines/HV/forcefield.lua 103 155 39.92% machines/HV/nuclear_reactor.lua 119 205 36.73% helpers.lua 54 100 35.06% machines/HV/quarry.lua 122 245 33.24% tools/sonic_screwdriver.lua 16 33 32.65% machines/compat/api.lua 16 34 32.00% tools/chainsaw.lua 37 80 31.62% machines/other/frames.lua 184 445 29.25% machines/compat/tools.lua 5 13 27.78% tools/mining_drill.lua 65 195 25.00% machines/other/anchor.lua 14 74 15.91% tools/prospector.lua 14 99 12.39% machines/compat/digtron.lua 4 41 8.89% machines/register/extractor_recipes.lua 6 65 8.45% ``` ### Raw test runner output for geeks: CNC: ``` ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 31 successes / 0 failures / 0 errors / 0 pending : 4.414275 seconds ``` Chests: ``` W: Configuration: invalid key exclude_textures ●●●●● 5 successes / 0 failures / 0 errors / 0 pending : 0.040852 seconds ``` Technic: ``` ●◌◌●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●● 197 successes / 0 failures / 0 errors / 4 pending : 11.70723 seconds Pending → spec/api_spec.lua @ 133 Technic API Machine registration registers my_mod:my_battery spec/api_spec.lua:133: Battery box registration does not include all fields Pending → spec/api_spec.lua @ 190 Technic API Machine registration registers my_mod:machine_base spec/api_spec.lua:190: Base machine registration does not include all fields Pending → spec/api_spec.lua @ 285 Technic API internals technic.cables TBD, misleading name and should be updated spec/api_spec.lua:285: TBD technic.cables naming and need, see technic networks data for possible options Pending → spec/supply_converter_spec.lua @ 78 Supply converter building overloads network spec/supply_converter_spec.lua:78: overload does not work with supply converter ```
S-S-X commented 2 years ago

Powerbanks compatibility done here: https://github.com/S-S-X/powerbanks/tree/technic-plus and this fork should be used, this time I also did quick testing in game and it seems to work fine.

Did not open PR for powerbanks compatibility. Will merge this PR tomorrow.

OgelGames commented 2 years ago

I've pushed a commit to https://github.com/OgelGames/powerbanks/pull/8 to fix the bug (sorry for forgetting about that). I tested it with this PR, the current master and the minetest-mods version, and it seems to work correctly with all of them now.

I'll be merging the powerbanks PR later today, so if there's anything you think I've missed, let me know :)