Repository navigation
test: skip plugin-feature-gated fixtures in corpus_parity (#1809) - #1812
Merged
Merged
Conversation
corpus_parity compares the featureless component wasm's load errors against the native rustledger_ffi_wasi::helpers::load_source reference. Under cargo test --workspace, feature unification compiles that native reference WITH python-plugins/wasm-plugins (the rustledger CLI enables them by default), so on a fixture declaring such a plugin it attempts the plugin and reports a real error, while the always-featureless component reports "requires the ...-plugins feature". Same function, two feature builds — an artifact, not a component regression. The divergence is invisible to CI (which never builds the debug wasm in a --workspace job) but breaks the local full-suite workflow for anyone who has. Skip a fixture when the component emits the plugin-feature-gate sentinel: it exercises a surface the featureless component structurally cannot implement. Keying on the component's sentinel rather than a source `plugin "..."` scan keeps NATIVE-Rust plugins (which the featureless component DOES run) in the compared set. The skip is surfaced as its own count in the summary line (no silent cap), and applies uniformly whether or not features are unified. The stale-cwasm-cache robustness bug this investigation also exposed is fixed separately in #1811. Closes #1809.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the corpus_parity integration test to avoid false mismatches caused by Cargo feature unification when running cargo test --workspace, where the native reference path may be compiled with python-plugins/wasm-plugins enabled while the component WASM remains intentionally featureless.
Changes:
- Skip corpus fixtures when the component returns the plugin feature-gate sentinel error (
"requires the …-plugins feature"), and track these skips separately in test output. - Rename loop variables (
nd/wd→native_dir/wit_dir) to avoid typos/clarity issues. - Expand the printed summary line to include the new “plugin-feature gate” skip count.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📊 Benchmark Results
vs main branch (2026-07-19)
What do these numbers mean?
|
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
…ings)
The first cut keyed the skip on the component's error alone, which the
deep review flagged as too weak. Tighten:
- Skip only when the component gated AND native did NOT gate. Requiring
!native_gated stops the over-skip in a featureless native build
(-p ...-tests, no feature unification), where both sides emit the same
gate message and legitimately compare EQUAL — those fixtures stay
covered (305 compared / 0 skipped) instead of being dropped, while the
unified --workspace build still skips the 4 (301 compared / 4 skipped).
- Match the exact "requires the {python,wasm}-plugins feature" phrases
rather than the loose "-plugins feature" substring, so a "Plugin not
found" error echoing a plugin name can't trigger an over-skip.
- Collapse guards: bound skipped_plugin_feature (<=30) and require most
fixtures to be compared (>= files/2), so a component regression that
emitted the gate broadly trips an assert instead of silently shrinking
the compared set to a green-but-empty run.
- Drift guard test plugin_feature_gate_message_is_stable: loads a Python
plugin through the featureless component and asserts the exact phrase
the skip matches, so a rustledger-loader reword fails there loudly
rather than breaking the corpus test spuriously.
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.
What
corpus_paritycompares the featureless component wasm'sloaderrors against the nativerustledger_ffi_wasi::helpers::load_sourcereference. Undercargo test --workspace, cargo feature unification compiles that native reference withpython-plugins/wasm-plugins(therustledgerCLI enables them by default), so on a fixture declaring such a plugin it attempts the plugin and reports a real error, while the always-featureless component reportsrequires the …-plugins feature. Same function, two feature builds — an artifact of the harness, not a component regression.The divergence is invisible to CI (which never builds the debug wasm in a
--workspacejob — verified: the workspace test job doesn't build wasm, the component-tests job builds wasm but runs-p …-tests, not--workspace), but it breaks the documented "run the full suite locally before pushing" workflow for anyone who has built the debug wasm.Why this shape of fix
The issue floated "compare against a
--no-default-featuresnative build" — that isn't achievable inside a single--workspacetest binary: features are already unified at link time, and whether the native reference is featured is decided by the rest of the build set, not by anything the test controls.So: skip a fixture when the component emits the plugin-feature-gate sentinel (
-plugins feature). Such a fixture exercises a surface the featureless component structurally can't implement, so asserting parity on it is meaningless. Keying on the component's sentinel rather than a sourceplugin "…"scan deliberately keeps native-Rust plugins — which the featureless component does run — in the compared set. The skip is surfaced as its own count in the summary line (no silent cap), and applies uniformly whether or not features are unified (301 compared / 4 plugin-feature-skipped in both configs).Not a product bug
The shipping component is featureless by design;
requires the …-plugins featureis its correct, intended message, and rustfava runs those plugins host-side. This PR only re-scopes the harness.Verification
Reproduced the original failure locally (build debug wasm,
cargo test --workspace), then confirmed the fix:corpus parity: compared 301, skipped 21 (of which 4 for the component's plugin-feature gate), green under both--workspace(unified) and-p rustledger-ffi-component-tests(featureless). Clippy/fmt clean. (The pre-existingnd/wdloop variables were renamed tonative_dir/wit_dir— touching the file made thetyposhook re-scan them,nd→and.)Related
The stale-
.cwasm-cache robustness bug this investigation also exposed (the 4th diverging fixture's environment-dependent deserialization error) is a real, user-facing bug fixed separately in #1811.Closes #1809.
🤖 Generated with Claude Code
https://claude.ai/code/session_013gJH7uBBF9Xw9et9QFRcsU