-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
The Testening: Ports improved unit tests from TG, New mapping tests, Refactors of existing tests to improve code quality #11364
The Testening: Ports improved unit tests from TG, New mapping tests, Refactors of existing tests to improve code quality #11364
Conversation
I have no idea why this is seg-faulting |
Co-Authored-By: Mothblocks <[email protected]>
Co-Authored-By: oranges <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some relatively small things. The python scripts aren't the best in terms of formatting and readability, but if they work I wont spend a lot of time trying to fix it (minus the two I started on)
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }} | ||
restore-keys: | | ||
${{ runner.os }}-spacemandmm- | ||
- name: Restore Yarn cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be a worse alternative to our current caching.. But it's a bit hard to tell without the checking being actively ran. This should be reviewed after this PR has been merged and checks have been running for a little while.
Co-authored-by: Crossedfall <[email protected]>
There are 3 greps that maplint is not currently expressive enough to handle
About The Pull Request
Ports the following PRs in whole, or in part (There's a lot, I apologise if I missed any PRs but I included the authors as commit co-authors where I could find them):
_unit_tests.dm
tgstation/tgstation#76404actions
to the Node 20 Version tgstation/tgstation#81770layer
var and scrubs it off our maps tgstation/tgstation#84385piping_layer
var and scrubs it off our maps tgstation/tgstation#84686Ports the following files (Authors have been credited):
https://github.com/tgstation/tgstation/commits/master/code/controllers/subsystem/garbage.dm
https://github.com/tgstation/tgstation/commits/master/code/__DEFINES/qdel.dm
https://github.com/tgstation/tgstation/blob/776ecd60600c43d56be173a9f10505425d2c07bc/code/__DEFINES/_helpers.dm#L29
https://github.com/tgstation/tgstation/blob/776ecd60600c43d56be173a9f10505425d2c07bc/code/datums/datum.dm#L75
tgstation/tgstation@225562b
Ports the better unit testing system that TG has.
Makes improvements to the create and delete tests by adding in defines which can be used modularly.
Ports some improvements and fixes to QDEL from TGstation (excluding some content which is 515 exclusive)
Non-Goals
JukeBuild Updates
Annotations
Any errors identified will be annotated inside of Github, click on a commit to see the errors being flagged.
Linter Expansion
Maplint
Maplint adds a simple way to check turfs for typepath based mapping related issues. This operates on the mapfile itself and isn't capable of more advanced logic, but it can catch simple things such as duplicate objects, or invalid var-edits. For more advanced map checks, I have added in a new category of unit tests; map tests.
The following tests will start disabled and will become enabled later:
OpenDream Linting
We now run the code against OpenDream, which will pick up some additional mistakes that Byond skips over.
Tab/Space Indentation
Ports the lint for tab vs space indentation. This lint was very flakey and was updated to allow spaces before a * symbol (as seen in block comments), however I still fixed all the issues that it brought up. A lot of these ended up being non-issues and resulted in a large number of diffs.
Test Expansion
Map Test Expansion
This adds a new abstract unit test type, map_test. This allows for you to do the following things:
This offers quite a lot of extensibility and can do things that maplint is incapable of, such as determining if something is valid relative to the surrounding tiles. It is currently used for the following things:
CreateAndDestroy Code Cleanup
Modularises the create and destoy code, instead of using a global list for the exclude variables a define has been added which excludes a type, or its subtypes. This has been applied to everything that requires multiple parameters in Initialize, under the assumption that if you need to pass something in, then it isn't something you can just new() safely. This is partly why this PR is so huge.
ScreenShot Tests
Adds support for screenshot tests, as seen on TG. This PR doesn't implement any screenshot tests however. We could likely use this framework to have automatic generation of rooms for PRs that resprite items.
Why It's Good For The Game
We can now run tests against maps, which is incredibly useful because maps often get errors. As a side effect, the mapping checks are strict but making them testable prevents avoidable errors, even if it is a bit annoying to update initially.
Testing Photographs and Procedure
Everything I am changing here has unit tests and are mistakes already, making this PR a little bit easier to go through.
Testing the tests
See the output at the bottom of this PR.
Testing random maints changes
Other
Changelog
🆑 PowerfulBacon, BriggsIDP, san7890, LemonInTheDark, MrStonedOne, Mothblocks, Cyberboss, Tastyfish, ZephyrTFA, Andrew, tattle, Jolly, die_amond, Tim, optimumtact, Y0SH1M4S73R, StyleMistake, other /TG/station contributors
fix: Adds in some map checker unit tests, which check disposal networks for correct sorting.
fix: Random maints will clean up directional wall items after spawning them if they were unable to be placed on a wall.
server: Improves unit testing
tweak: Changed disposal pipe sorting logic slightly. Entering a sorting pipe backwards will continue backwards, entering a pipe from the sort direction will send you forwards. Entering from the correct direction will continue to sort.
add: Adds a new disposal pipe for filtering unsorted items that need sorting.
fix: Packages will now always arrive in their destination, no matter where on the network they are entered.
tweak: Fridges are no longer placed in walls
tweak: All areas must have APCs, unless they are unpowered.
/:cl: