test: give the declare_commands tree the packet's rootIndex - #1527
Open
u9g wants to merge 1 commit into
Open
Conversation
The tree the test emits has no rootIndex, so the client reads nodes[undefined], rejects the tree and ends the connection, and the test's only assertion never runs. It has failed since it was added. Nothing reported it because CI runs mochaTest with a -g filter on the Minecraft version and no name in this file carries one.
u9g
added a commit
to u9g/node-minecraft-protocol
that referenced
this pull request
Sep 7, 2026
…e grep CI ran mochaTest with -g <version>v, so a suite only ran if its title carried a Minecraft version. The three suites that are not version-parameterised, declare_commands handling, lpVec3 and ping, never ran in any job. The version loops now read the list from test/common/testedVersions, which honours MC_VERSION and rejects a value that is not a supported version, so CI selects the version without touching test titles and every suite runs in every job. Running mocha with no MC_VERSION still tests every supported version. declare_commands handling fails until PrismarineJS#1527 lands, which is the tree fix this filter was hiding.
This was referenced Sep 7, 2026
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.
The
declare_commandspacket carriesnodesandrootIndex. The tree this test emits has norootIndex, so the client readsnodes[undefined], rejects the tree and ends the connection, and the assertion never runs.Invariant: a
declare_commandspacket built by a test names its root, so the client accepts the tree.The test has failed since it was added. CI does not report it:
mochaTestis invoked with-g <version>vand no name in this file carries a Minecraft version, so the file never runs. #1526 removes that filter.