Build and pin the real bread-module-host binary for integration tests #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/module-host-test-harness"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to the post-merge review comment on #6 (the round-3 CI fix commits 5059771/af38653): those got CI green, but the reviewer flagged three real fragility gaps in
ipc_integration.rs's nestedcargo build -p bread-module-hosthelper:module_host_sandbox.rsnever called it at all, relying onipc_integrationhappening to build first in target order. Its own header note still claimedcargo test --workspacealready built the binary, which theaf38653commit message itself disproved.target/{debug,release}layout, so--release, a custom--target-dir, or a cross-compiling--targetwould miss it.PATHlookup, which can silently succeed against a stale, separately installed~/.local/bin/bread-module-hostinstead of the binary the test run just built, meaning a test could pass while exercising the wrong code.What changed
breadd/tests/common/mod.rs, used by bothipc_integration.rsandmodule_host_sandbox.rs, and fixed the latter's stale note.cargo build -p bread-module-host --locked --message-format=jsonand reads the path back out of thecompiler-artifactmessage'sexecutablefield, instead of guessing a location. This is correct under any profile,CARGO_TARGET_DIR, orCARGO_BUILD_TARGET, since those are ordinary environment variables cargo already honours and the nestedCommandinherits from the test process.breaddthey spawn through a newBREAD_MODULE_HOST_BINenv var, whichresolve_module_host_binarychecks first, ahead of its normalcurrent_exe()-relative resolution and before ever reaching thePATHfallback.cargo build --workspacestep tocheck.ymlbefore the test step, as cheap extra insurance alongside the in-test fix (the review's "cheaper alternative, or in addition").Verification
CARGO_TARGET_DIR:cargo build --workspace --locked,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo fmt --all -- --check, andcargo test --workspace --locked, all clean (163 breadd unit tests, 37ipc_integrationtests, 2module_host_sandboxtests).cargo test -p breadd --locked --test module_host_sandboxrun alone, from a brand-new empty target dir, with nothing else having builtbread-module-hostfirst. Confirmed the binary actually gets built at that fresh target dir (debug/bread-module-host) by this helper, and both tests pass.cargo build,cargo clippyandcargo test --workspace --lockedruns inside this repo's own pinned CI container viaci/build.sh(the same one CI uses), all green.No merge; leaving this for review.
Relates to ECO-34.