Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use documented ItemStack constructor for tests #343

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

S-S-X
Copy link
Member

@S-S-X S-S-X commented Jan 14, 2024

There will be nothing else, this simply stops using undocumented ItemStack() constructor in tests and switches to documented ItemStack(nil).

Undocumented one also actually did not work on every engine version, I think it works with latest.

Copy link

Click for detailed source code test coverage report

Test coverage report for Technic CNC 79.17% in 11/14 files:

File                             Hits Missed Coverage
-----------------------------------------------------
materials/init.lua             10   0      100.00%
init.lua                       16   0      100.00%
digilines.lua                  55   0      100.00%
formspec.lua                   99   7      93.40%
cnc.lua                        38   4      90.48%
programs.lua                   184  26     87.62%
api.lua                        211  43     83.07%
materials/basic_materials.lua  14   3      82.35%
materials/technic_worldgen.lua 26   6      81.25%
materials/default.lua          147  36     80.33%
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 39.94% in 6/6 files:

File          Hits Missed Coverage
----------------------------------
chests.lua    63   18     77.78%
init.lua      32   18     64.00%
register.lua  67   78     46.21%
formspec.lua  76   94     44.71%
inventory.lua 6    101    5.61%
digilines.lua 2    61     3.17%

Test coverage report for technic 62.34% in 97/97 files:

File                                      Hits Missed Coverage
--------------------------------------------------------------
max_lag.lua                               12   0      100.00%
materials.lua                             71   0      100.00%
machines/register/init.lua                15   0      100.00%
machines/register/freezer_recipes.lua     14   0      100.00%
machines/other/init.lua                   6    0      100.00%
machines/MV/init.lua                      17   0      100.00%
machines/MV/generator.lua                 8    0      100.00%
machines/MV/centrifuge.lua                11   0      100.00%
machines/MV/cables.lua                    29   0      100.00%
machines/MV/battery_box.lua               8    0      100.00%
machines/MV/alloy_furnace.lua             13   0      100.00%
machines/LV/init.lua                      17   0      100.00%
machines/LV/generator.lua                 9    0      100.00%
machines/LV/cables.lua                    30   0      100.00%
machines/LV/battery_box.lua               8    0      100.00%
machines/LV/alloy_furnace.lua             14   0      100.00%
machines/HV/init.lua                      12   0      100.00%
machines/HV/generator.lua                 8    0      100.00%
machines/HV/cables.lua                    28   0      100.00%
machines/HV/battery_box.lua               8    0      100.00%
legacy.lua                                8    0      100.00%
crafts.lua                                109  1      99.09%
machines/LV/led.lua                       58   1      98.31%
items.lua                                 85   2      97.70%
machines/register/compressor_recipes.lua  39   1      97.50%
machines/register/grindings.lua           36   1      97.30%
machines/register/solar_array.lua         46   2      95.83%
machines/LV/geothermal.lua                69   3      95.83%
config.lua                                23   1      95.83%
machines/network.lua                      400  21     95.01%
machines/LV/solar_panel.lua               36   2      94.74%
machines/LV/compressor.lua                17   1      94.44%
tools/init.lua                            13   1      92.86%
machines/LV/grinder.lua                   13   1      92.86%
init.lua                                  25   2      92.59%
machines/register/cables.lua              97   8      92.38%
machines/LV/electric_furnace.lua          12   1      92.31%
machines/MV/grinder.lua                   11   1      91.67%
machines/MV/freezer.lua                   11   1      91.67%
machines/MV/extractor.lua                 11   1      91.67%
machines/MV/electric_furnace.lua          11   1      91.67%
machines/MV/compressor.lua                11   1      91.67%
machines/HV/grinder.lua                   11   1      91.67%
machines/HV/electric_furnace.lua          11   1      91.67%
machines/HV/compressor.lua                11   1      91.67%
machines/compat/tools.lua                 58   6      90.63%
machines/register/recipes.lua             131  14     90.34%
machines/MV/solar_array.lua               9    1      90.00%
machines/LV/water_mill.lua                54   6      90.00%
machines/LV/solar_array.lua               8    1      88.89%
machines/HV/solar_array.lua               8    1      88.89%
register.lua                              28   4      87.50%
machines/register/grinder_recipes.lua     100  16     86.21%
machines/LV/lamp.lua                      93   17     84.55%
util/throttle.lua                         9    2      81.82%
machines/register/battery_box.lua         235  55     81.03%
tools/flashlight.lua                      56   14     80.00%
machines/init.lua                         34   9      79.07%
machines/register/alloy_recipes.lua       32   9      78.05%
machines/register/machine_base.lua        167  52     76.26%
machines/other/coal_furnace.lua           3    1      75.00%
machines/register/centrifuge_recipes.lua  20   7      74.07%
machines/power_monitor.lua                52   19     73.24%
machines/overload.lua                     12   5      70.59%
machines/LV/extractor.lua                 14   6      70.00%
machines/switching_station.lua            73   32     69.52%
machines/supply_converter.lua             91   46     66.42%
machines/switching_station_globalstep.lua 28   16     63.64%
machines/MV/wind_mill.lua                 37   22     62.71%
machines/other/injector.lua               71   44     61.74%
tools/multimeter.lua                      125  79     61.27%
effects.lua                               3    2      60.00%
machines/register/generator.lua           115  83     58.08%
machines/MV/tool_workshop.lua             59   43     57.84%
machines/MV/hydro_turbine.lua             31   26     54.39%
radiation.lua                             96   81     54.24%
machines/other/coal_alloy_furnace.lua     70   65     51.85%
machines/LV/music_player.lua              44   47     48.35%
tools/mining_lasers.lua                   32   35     47.76%
tools/cans.lua                            39   48     44.83%
machines/register/common.lua              51   64     44.35%
machines/other/constructor.lua            61   78     43.88%
tools/vacuum.lua                          14   20     41.18%
tools/tree_tap.lua                        18   30     37.50%
helpers.lua                               53   98     35.10%
machines/HV/forcefield.lua                84   158    34.71%
machines/HV/quarry.lua                    129  251    33.95%
machines/HV/nuclear_reactor.lua           107  214    33.33%
machines/compat/api.lua                   16   34     32.00%
tools/chainsaw.lua                        37   80     31.62%
tools/sonic_screwdriver.lua               15   33     31.25%
tools/mining_drill.lua                    60   195    23.53%
chatcommands.lua                          13   45     22.41%
machines/other/anchor.lua                 12   74     13.95%
tools/prospector.lua                      12   100    10.71%
machines/compat/digtron.lua               4    41     8.89%
machines/register/extractor_recipes.lua   7    77     8.33%

Raw test runner output for geeks:

CNC:

++ Executing suite spec/api_spec.lua
++ Executing suite spec/digilines_spec.lua
++ Executing suite spec/interaction_spec.lua
++ Executing suite spec/technic_cnc_spec.lua⭆ Starting test set technic_cnc_spec.lua:17 ⯈ Technic CNC
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded


31 successes / 0 failures / 0 errors / 0 pending : 7.158929 seconds

Chests:

++ Executing suite spec/api_spec.lua
W:	Configuration: invalid key	exclude_textures


5 successes / 0 failures / 0 errors / 0 pending : 0.186214 seconds

Technic:

++ Executing suite spec/api_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
◌◌⭆ Starting test set api_spec.lua:204 ⯈ Technic API Machine use
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded
◌
++ Executing suite spec/building_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin

++ Executing suite spec/hv_network_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
⭆ Starting test set hv_network_spec.lua:11 ⯈ HV machine network
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded

++ Executing suite spec/lv_network_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
⭆ Starting test set lv_network_spec.lua:11 ⯈ LV machine network
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded

++ Executing suite spec/network_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin

++ Executing suite spec/nodes_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
⭆ Starting test set nodes_spec.lua:11 ⯈ Technic node placement
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded

++ Executing suite spec/supply_converter_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
◌
++ Executing suite spec/tools_compatibility_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
⭆ Starting test set tools_compatibility_spec.lua:11 ⯈ Technic power tool compatibility
W:	Deprecated technic.register_power_tool use. Setting max_charge for oldlegacy:powertool
W:	Deprecated technic.register_power_tool use. Setting max_charge for oldminimal:powertool
W:	Deprecated technic.register_power_tool use. Setting max_charge for oldhalfway:powertool
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded
W:	Deprecated technic.register_power_tool use. Ensuring fields for oldlegacy:powertool
W:	Using metadata charge values for oldlegacy:powertool
W:	Updated legacy Technic power tool definition for oldlegacy:powertool
W:	Deprecated technic.register_power_tool use. Ensuring fields for oldminimal:powertool
W:	Using metadata charge values for oldminimal:powertool
W:	Updated legacy Technic power tool definition for oldminimal:powertool
W:	Deprecated technic.register_power_tool use. Ensuring fields for oldhalfway:powertool
W:	Mod oldhalfway seems to be aware of technic.plus but oldhalfway:powertool is still using deprecated registration, skipping meta charge compatibility.
W:	Updated legacy Technic power tool definition for oldhalfway:powertool
🢆 Running tests from tools_compatibility_spec.lua:92 ▷ Technic power tool compatibility oldlegacy:powertool can be used (minimum charge)
W:	Use of deprecated function technic.set_RE_wear with stack: oldlegacy:powertool
🢆 Running tests from tools_compatibility_spec.lua:106 ▷ Technic power tool compatibility oldlegacy:powertool can be used (minimum charge + 1)
W:	Use of deprecated function technic.set_RE_wear with stack: oldlegacy:powertool
🢆 Running tests from tools_compatibility_spec.lua:92 ▷ Technic power tool compatibility oldminimal:powertool can be used (minimum charge)
W:	Use of deprecated function technic.set_RE_wear with stack: oldminimal:powertool
🢆 Running tests from tools_compatibility_spec.lua:106 ▷ Technic power tool compatibility oldminimal:powertool can be used (minimum charge + 1)
W:	Use of deprecated function technic.set_RE_wear with stack: oldminimal:powertool

++ Executing suite spec/tools_spec.lua
E:	Loading common/fs from 5.4.1 failed, trying to use builtin
⭆ Starting test set tools_spec.lua:13 ⯈ Technic power tool
W:	Unsupported registration overrides detected for core.registered_on_mods_loaded


219 successes / 0 failures / 0 errors / 4 pending : 58.466756 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

@BuckarooBanzay BuckarooBanzay merged commit ebe381c into master Jan 15, 2024
10 checks passed
@BuckarooBanzay BuckarooBanzay deleted the reduce-test-logs branch January 15, 2024 13:15
@Athozus Athozus added this to the 2.0.0 milestone Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants