Add comprehensive unit test suite for datapack validation#4
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add comprehensive unit test suite for datapack validation#4devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- 327 tests across 8 test modules covering all datapack modules - Tests: pack structure, JSON validity, function references, scoreboard consistency, team consistency, class system, game flow / state machine, core mechanics, uninstall completeness, and mcfunction syntax validation - Flags 6 known bugs via xfail: - Squad directory case mismatch (Squad/ vs squad/ in function refs) - 5 undeclared scoreboard objectives for Squad subsystem - Add .gitignore for __pycache__ and .pytest_cache Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The datapack had zero test coverage. This PR adds a Python/pytest test suite (327 tests across 8 modules) that validates every module of the datapack without needing a running Minecraft server.
What's tested:
test_pack_structurepack.mcmetavalidity, directory layout, pack_format=15test_json_validityload.json/tick.jsonreferences resolve,kill.jsonstructuretest_function_referencesfunction bf:...call resolves to an existing.mcfunctionfiletest_scoreboard_consistencysetup.mcfunction↔uninstall.mcfunctionsymmetry; used objectives are declaredtest_team_consistencytest_class_systemtest_game_flowtest_mechanicstest_mcfunction_syntaxtest_uninstallKnown bugs surfaced (marked
xfail):Squad/directory uses uppercase but function references use lowercasesquad/— breaks on case-sensitive Linux filesystemsbf_squad,bf_sq_count,bf_sq_dep,bf_sq_prev,bf_join_sq) are used but never declared insetup.mcfunctionkill.jsonhas an empty"function"reward value (invalid JSON)Run:
python -m pytest tests/ -vLink to Devin session: https://app.devin.ai/sessions/ac54546a203243b5a8069a40919267e3
Requested by: @DanyouTu