test(bin-e2e): dlopen the shipped js plugin cdylib for real - #370
Draft
raphaelvigee wants to merge 1 commit into
Draft
test(bin-e2e): dlopen the shipped js plugin cdylib for real#370raphaelvigee wants to merge 1 commit into
raphaelvigee wants to merge 1 commit into
Conversation
Closes a gap flagged repeatedly since M0: plugin-js-cdylib was lint/fmt covered (devenv.nix's qualityCrates) but never actually loaded across the real ABI seam by any test. Wires it into the e2e devenv script as a fourth staged artifact (symmetric with go/gha in both the local-build and HEPH_E2E_FROM/CI branches), and adds four real bin-e2e tests proving it: - shipped_js_cdylib_loads_and_answers_across_the_abi: construction + the sync inspect functions ABI call round-trips cleanly. The js Provider never overrides functions() (falls through to the trait's empty-vec default, unlike go's build_addr), so this asserts no line in `inspect functions` output starts with "js." rather than asserting empty stdout outright -- the fs provider's own functions are always registered regardless of plugin config, so an empty-stdout assertion is simply wrong (caught by review, the first draft failed deterministically). - shipped_js_cdylib_discovers_a_real_workspace_package: query -e //... against a real pnpm-shaped fixture resolves //packages/foo:package_info -- proves Provider::list/list_packages cross the seam intact. - shipped_js_cdylib_resolves_pnpm_workspace_glob_membership: two real package.json files, one inside the packages/* glob and one deliberately outside it declared as a dependency; resolving the in-glob package's config must fail on the unresolved dependency, proving the excluded package was never admitted as a workspace member. Added because the discovery test above (despite its own doc comments originally claiming otherwise) never actually exercises workspace.rs's glob-membership resolution -- Provider::list discovers by package.json presence alone, independent of pnpm-workspace.yaml. Caught by review; the stale overclaiming comments were corrected rather than left standing. - js_plugin_construction_failure_logs_before_the_abort: the same log-sink-before-abort regression coverage the go test already has, ported for js's identical construction-failure shape. Verified for real: ran the full `e2e` devenv script (release build of heph + all three plugin cdylibs, staged, macOS-portable-patched) end to end -- 17/17 tests passed across the whole bin-e2e suite, all four new plugin_dylib_js.rs tests included, against real dlopen'd release artifacts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3wZfyPsG8stfRQuybLRjN
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.
Part 8/8 of the stack — closes a gap flagged repeatedly since M0:
plugin-js-cdylibwas lint/fmt covered (devenv.nix'squalityCrates) but never actually loaded across the real ABI seam by any test.What's here
devenv.nix'se2escript now stagesplugin-js-cdylibas a fourth artifact, symmetric with go/gha in both the local-build andHEPH_E2E_FROM/CI branches (fingerprinting, copying, macOS-portable-patching all updated together).bin-e2etests incrates/bin-e2e/tests/plugin_dylib_js.rs:shipped_js_cdylib_loads_and_answers_across_the_abi— construction + the syncinspect functionsABI call round-trips cleanly.shipped_js_cdylib_discovers_a_real_workspace_package—query -e //...against a real pnpm-shaped fixture resolves//packages/foo:package_info.shipped_js_cdylib_resolves_pnpm_workspace_glob_membership— proves a package outside thepackages/*glob is never admitted as a workspace member, across the real seam.js_plugin_construction_failure_logs_before_the_abort— the same log-sink-before-abort regression coverage the go test already has.Two things review caught worth naming
The first draft of
shipped_js_cdylib_loads_and_answers_across_the_abiassertedinspect functionsproduced completely empty stdout — wrong, and it failed deterministically: thefsbuiltin provider's own functions are always registered regardless of plugin config, so stdout is never actually empty. Fixed to assert no line starts withjs.instead (the jsProvidernever overridesfunctions(), unlike go'sbuild_addr).The discovery test's own doc comments originally claimed to exercise pnpm's workspace-glob membership resolution — they didn't. Traced it:
Provider::list/list_packagesdiscover packages bypackage.jsonpresence alone, independent ofpnpm-workspace.yamlcontent entirely; the glob-resolution path (workspace.rs'sresolve_members) is only reached fromProvider::get, which a plainquery -e //...never calls. Rather than leave an overclaiming comment standing, added the dedicatedshipped_js_cdylib_resolves_pnpm_workspace_glob_membershiptest that actually reaches that path, and corrected the original test's docs.Verified for real, not just compiled
Ran the full
e2edevenv script end to end — release build ofheph+ all three plugin cdylibs, staged, macOS-portable-patched, fullbin-e2esuite against real dlopen'd artifacts:Test plan
cargo build -p bin-e2e --testscargo clippy -p bin-e2e --all-targets -- -D warnings(clean)cargo fmt --check -p bin-e2enix-instantiate --parse devenv.nixe2erun against real staged release artifacts — 17/17 passedtst,lint,bin_e2e) on this PRStack created with GitHub Stacks CLI • Give Feedback 💬