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

Remove leftovers from frames, add README.md for Mineunit spec dirs #355

Merged
merged 5 commits into from
Mar 30, 2024

Conversation

imre84
Copy link
Contributor

@imre84 imre84 commented Mar 27, 2024

as far as I'm able to tell enable_frames doesn't do anything, I removed that, and also updated technic/spec/fixtures/technic.conf to reflect the defaults as per technic/config.lua

low impact PR

@OgelGames OgelGames requested a review from S-S-X March 27, 2024 12:37
Copy link
Member

@S-S-X S-S-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mineunit tests are supposed to load in as much as possible instead of simply reflecting default config.
Integration tests AFAIK use default configuration but is simply just validating that mod can be loaded without crashing.

Flashlight tool for example is actually tested with Mineunit and not having it causes this:

Failure → spec/tools_spec.lua @ 275
Technic power tool Flashlight is registered
spec/tools_spec.lua:276: Expected nil to be hash table

Error → spec/tools_spec.lua @ 283
Technic power tool Flashlight charge is used
spec/tools_spec.lua:286: attempt to index upvalue 'itemdef' (a nil value)

enable_frames could be removed if there's no references to it anymore, should not be and just managed to get through when those were removed:

@S-S-X
Copy link
Member

S-S-X commented Mar 27, 2024

Wouldn't start limiting tests to only default stuff, if there's special need to actually run tests for default configuration it can be done as a separate configuration test utilizing multiple configuration files one for each scenario (like default, all enabled, all disabled, etc.).

For information, currently things that are actually tested in one way or another:

  • CNC digiline API
    • handles invalid messages
    • sets program and size
    • sets size
    • table disables machine
    • table enables machine
    • string disables machine
    • string enables machine
    • returns programs
    • returns status
  • Technic CNC
    • technic:cnc
      • produces items
      • uses energy
    • technic:cnc_mk2
      • produces items
      • uses energy
      • disabling and enabling
  • CNC formspec interaction
    • allows placing materials
    • allows placing materials protected
    • disallows placing materials protected
    • does not check protection for noop actions
    • checks protection for programming
    • sets metadata on form submit
    • manufactures products
    • updates old machines
  • CNC API
    • Machine control
      • returns product item string
      • configures new program
      • fails configuring invalid program
      • machine is enabled by default
      • disables machine
      • enables machine
      • manufactures products
      • fails manufacturing products
    • Machine registration
      • registers example machine
  • Chests API
    • registered builtin chests
    • default builtin descriptions
    • registers chest
    • registers locked chest
    • registers protected chest
  • Supply converter
    • building
      • does not crash
      • is added to network without duplicates
      • does not remove connected machines from network
      • does not remove networks
      • does not add cables to network
      • overloads network
    • digging
      • does not crash
      • is removed from network
      • does not remove other nodes from network
      • does not remove network
    • formspec
      • is protected
  • HV machine network
    • executes network
    • kills network when switching station disappear
    • charges battery box
    • smelts ores
    • grinds ores
  • Technic node placement
    - player can place
    • cable plates
      • normal placement
        • plate_1
        • plate_2
        • plate_3
        • plate_4
        • plate_5
        • plate_6
      • middle aux1 placement
        • heading X-
        • heading Y-
        • heading Z-
        • heading X+
        • heading Y+
        • heading Z+
      • aux1 placement pointing X+ edge
        • heading Z+
        • heading Y-
      • aux1 placement pointing Z+ edge
        • heading X-
        • heading Y-
        • heading X+
        • heading Y+
    • gloabalstep works
  • Technic power tool compatibility
    describe(itemname, function()
    - is registered
    - can be used (zero charge)
    - itemdef.technic_get_charge works (zero charge)
    - itemdef.technic_set_charge works (zero charge -> 123)
    - can be used (minimum charge)
    - can be used (minimum charge + 1)
    - can be charged
    - can be discharged
  • LV machine network
    • executes network
    • kills network when switching station disappear
    • charges battery box
    • smelts ores
    • grinds ores
    • comperess sand
    • cuts power when generators disappear
  • Power network building
    • cable building
      • does not crash
      • is added to network
      • adds all network nodes
      • adds connected machines to network without duplicates
    • cable building to machine
      • does not crash
      • is added to network
      • adds all network nodes
      • adds connected machines to network without duplicates
      • does not add unconnected cables to network
      • does not duplicate already added machine
    • machine building
      • does not crash
      • is added to network without duplicates
      • does not remove connected machines from network
      • does not remove network
      • does not add cables to network
      • overloads network
    • cable building between networks
      • does not crash
      • removes network
    • cable cutting
      • does not crash
      • is removed from network
      • removes connected cables from network
      • removes connected machines from network
      • removes network
    • cable digging below machine
      • does not crash
      • is removed from network
      • removes connected machines from network
      • does not remove network
      • keeps connected machines in network
    • machine digging
      • does not crash
      • is removed from network
      • does not remove other nodes from network
      • does not remove connected machines from network
      • does not remove network
  • Technic power tool
    • API
      • technic.register_power_tool works
      • technic.use_RE_charge works (zero charge)
      • technic.get_RE_charge works (zero charge)
      • technic.set_RE_charge works (zero charge -> 123)
      • technic.use_RE_charge works (minimum charge)
      • technic.use_RE_charge works (minimum charge + 1)
    • charging and discharging extreme ratios
      • t1_1 can be charged
      • t1_2 can be charged
      • t1_10001 can be charged
      • t1_65535 can be charged
      • t1_65536 can be charged
      • t100_6553500 can be charged
      • t100_6553600 can be charged
      • t100_6553600 can be used
    • Flashlight
      • is registered
      • charge is used
    • Multimeter
      • is registered
      • new item can be used
      • has zero charge
      • can be charged
      • charge is used
      • can be discharged
    • technic_addons:chainsawmk3
      • is registered
      • new item can be used
      • has zero charge
      • can be charged
      • charge is used
  • Power network helper
    • network lookup functions
      • does not fail if network missing
      • returns correct position for network
      • returns correct network for position
      • returns nil tier for empty position
      • returns correct tier for switching station position
    • network constructors/destructors
      • creates network
      • builds network
      • does not add duplicates to network
      • removes network
    • Power network timeout functions technic.touch_node and technic.get_timeout
      • returns zero if no data available
      • returns timeout if data is available
  • Network initialization
    • overload
      • networks connected through machine
  • technic.merge_networks
    • function behavior
      • merges networks
      • merges networks again
    • network building behavior
      -- only be used inside it(...) so we go with strict_setup/strict_teardown.
      • stops network building after first iteration
      • continues network building
      • merges with second network
      • finishes network build
  • Technic API
    • Machine registration
      • registers my_mod:my_solar_array
      • registers my_mod:my_battery
      • registers my_mod:machine_base
    • Machine use
      • runs my_mod:my_solar_array
      • runs my_mod:my_battery
  • Technic API internals
    • technic.machines contain only machines
    • technic.cables TBD, misleading name and should be updated

@imre84
Copy link
Contributor Author

imre84 commented Mar 28, 2024

bf7a18b isn't supposed to be part of this PR

@imre84
Copy link
Contributor Author

imre84 commented Mar 29, 2024

Hello, I understand neither messages sent by S-S-X

@S-S-X S-S-X added the Cleanup Cleanup of bad code or other redundant/unnecessary stuff label Mar 29, 2024
README.md Outdated Show resolved Hide resolved
@imre84
Copy link
Contributor Author

imre84 commented Mar 29, 2024

please disregard this PR, how do I delete it?

@S-S-X
Copy link
Member

S-S-X commented Mar 29, 2024

please disregard this PR, how do I delete it?

Can be just closed or if you like you could also just revert technic/spec/fixtures/technic.conf to version in master branch and then we merge that simple README.md change, it isn't big change but it is still good as it would remove unneeded legacy stuff.

I mean just git checkout origin/master technic/spec/fixtures/technic.conf and commit as usual, will be squashed together anyway when merging.

@S-S-X S-S-X changed the title technic/spec/fixtures/technic.conf updated to reflect the defaults Remove frames from README.md config section, add README.md for Mineunit spec dir Mar 29, 2024
Copy link
Member

@S-S-X S-S-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me: simple README.md cleanup + adds note to communicate spec directory purpose.

Frames were removed here: #290

Same note could be also added to CNC and chests spec directories but fine for me either way.

@S-S-X S-S-X changed the title Remove frames from README.md config section, add README.md for Mineunit spec dir Remove leftovers from frames, add README.md for Mineunit spec dirs Mar 30, 2024
@S-S-X S-S-X merged commit bc07148 into mt-mods:master Mar 30, 2024
5 checks passed
@S-S-X
Copy link
Member

S-S-X commented Mar 30, 2024

Noticed that enable_frames was also on technic.conf for Mineunit so removed it from there too. Searched a bit if there's anything else about frames and didn't found anything, should be clean now.

@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
Cleanup Cleanup of bad code or other redundant/unnecessary stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants