Repository navigation
Fix game tests counting stray item entities from other tests - #16
Merged
Merged
Conversation
Coverage Report for CI Build 38268669871Coverage increased (+0.01%) to 76.541%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions6 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Drop assertions searched a box reaching outside the test structure, where leftover drops of earlier tests are not cleared. In packtests, this made testUpgradesTravelWithCore see 4 item entities instead of 1. Only count item entities spawned by the action under test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JiCU3f3K3TAcHBc5m9nXCD
rubensworks
force-pushed
the
claude/fervent-mayer-okwvhr
branch
from
October 12, 2026 15:13
3ae8e90 to
06995fa
Compare
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.
Fixes the packtests failure in https://github.com/CyclopsMC/packtests/actions/runs/38193323122/job/114630549638:
Cause
breakCoreAndPickUpcounted everyItemEntitywithininflate(2)of the core. The core sits at relative z=1, so the box reaches z=-1, outside the test structure. Vanilla only clears entities inside the structure bounds, and packtests runs batches of 50 tests from many mods on reused grid spots. So leftover drops from earlier tests got counted (4 instead of 1). This is an issue in the test, not in the mod.Fix
Added
itemEntitiesSpawnedBy, which snapshots the item entities in the area, runs the action, and returns only the new ones. Applied it to the assertions with the same weakness:breakCoreAndPickUp(the failing one)breakCoreAsPlayertestCreativeBreakEmptyCoreDropsNothing(asserted no core item within radius 3)testBuildCommandRefusals(asserted no drops within radius 8)Targets
master-1.21-ltsso it upmerges intomaster-26-lts, which has the same code. The cherry-pick onto 26 only differs in the permission constant (LevelBasedPermissionSet.GAMEMASTERvsCommands.LEVEL_GAMEMASTERS).Verification
master-1.21-lts(1.21.1):./gradlew buildand./gradlew runGameTestServerpass on all loaders.master-26-lts(26.1.2): same, and I reproduced the packtests error locally by planting 3 stray items just outside the structure next to the core. The old helper fails with the identical message (to be 4: was 1), the new helper passes.🤖 Generated with Claude Code
https://claude.ai/code/session_01JiCU3f3K3TAcHBc5m9nXCD