test: fix stale malformed-label e2e test, split by failure site#106
Merged
Conversation
Since repo builds started re-merging inherited labels into the cache tag (stamp_repo_image_labels), a malformed org.outrig.mcp label hard-errors during ensure_image itself, so the old malformed_mcp_label_is_hard_error test panicked in its fixture helper before reaching the runtime-read assertion. The build-time failure is the better behavior; the test now asserts it directly. The runtime-read path is still reachable: the ImageSourceRef::Image branch only probes/pulls and never re-validates labels, so a raw (non-built) image ref with a malformed label passes ensure_image and fails only at embedded::merged_mcp. A new e2e case covers it, building the raw fixture with image::build_standalone (which stamps nothing beyond the Dockerfile's own labels) under a fixed tag rebuilt each run. merged_mcp reads labels off the handle's image tag without exec'ing, so the test uses Container::attach instead of a full start/bootstrap/stop cycle, and both malformed-label fixtures are bare alpine + LABEL -- no node toolchain, no shadow. Also dedupes the Build-source ImageConfig literal behind a shared fallible try_ensure_built_image helper and adds a non-e2e unit test pinning the hard-error site (merged_mcp_config_to_labels rejects a malformed inherited label) in plain cargo test.
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.
Since repo builds started re-merging inherited labels into the cache tag (stamp_repo_image_labels), a malformed org.outrig.mcp label hard-errors during ensure_image itself, so the old malformed_mcp_label_is_hard_error test panicked in its fixture helper before reaching the runtime-read assertion. The build-time failure is the better behavior; the test now asserts it directly.
The runtime-read path is still reachable: the ImageSourceRef::Image branch only probes/pulls and never re-validates labels, so a raw (non-built) image ref with a malformed label passes ensure_image and fails only at embedded::merged_mcp. A new e2e case covers it, building the raw fixture with image::build_standalone (which stamps nothing beyond the Dockerfile's own labels) under a fixed tag rebuilt each run. merged_mcp reads labels off the handle's image tag without exec'ing, so the test uses Container::attach instead of a full start/bootstrap/stop cycle, and both malformed-label fixtures are bare alpine + LABEL -- no node toolchain, no shadow.
Also dedupes the Build-source ImageConfig literal behind a shared fallible try_ensure_built_image helper and adds a non-e2e unit test pinning the hard-error site (merged_mcp_config_to_labels rejects a malformed inherited label) in plain cargo test.
Summary
What does this change, and why?
Checklist
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningsis cleancargo test --workspacepassesdoc/updated if behavior changed (mdbook buildstill clean)Notes for reviewers
Anything worth calling out -- tricky bits, follow-ups, or intentionally out-of-scope items.