Skip to content

test: stop depending on JSON key order in the fabric depends test - #1065

Merged
LynithDev merged 2 commits into
Polyfrost:mainfrom
tunaseckin:fix/depends-test-key-order
Oct 25, 2026
Merged

LynithDev merged 2 commits into
Polyfrost:mainfrom
tunaseckin:fix/depends-test-key-order

Conversation

@tunaseckin

Copy link
Copy Markdown
Contributor

fabric_dependencies_list_depends_keys fails on main:

left: ["fabric-api", "sodium"]
right: ["sodium", "fabric-api"]

depends is a JSON object, and serde_json keeps declaration order only when its preserve_order feature is enabled somewhere in the build. It isn't right now, so the keys come back sorted. The only caller (local_manifest.rs:566) sorts and dedups requires anyway, so the order never mattered outside this test.

The test now sorts before comparing, so it passes whether or not preserve_order gets turned on again. cargo test -p oneclient_content --lib goes from 1 failure to 0.

depends is a JSON object, and serde_json only keeps declaration order
when its preserve_order feature is on somewhere in the build. It is not
on now, so the keys come back sorted and the test failed on main. The
only caller sorts requires anyway, so the test now does the same.
@LynithDev
LynithDev merged commit 69e6993 into Polyfrost:main Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants