test: add failure propagation e2e test for odin_test#11
Merged
Conversation
Validates that odin_test correctly propagates non-zero exit codes from failing @(test) procedures to Bazel's test infrastructure. Architecture (follows rules_rust pattern): - Separate e2e workspace (e2e/failure_propagation/) with own MODULE.bazel - odin_test target tagged 'manual' (intentionally failing: 1+1==3) - sh_test executes the compiled binary directly via runfiles and asserts non-zero exit code (no Bazel-in-Bazel subprocess) - Uses rules_shell + rlocationpath for cross-platform binary resolution CI: adds failure_propagation step to the test matrix (4 OS × 3 Bazel).
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.
Summary
Adds a negative e2e test that validates
odin_testcorrectly propagates non-zero exit codes from failing@(test)procedures to Bazel's test infrastructure.Architecture
Follows the rules_rust pattern (one workspace per e2e scenario):
How it works
odin_test(name = "should_fail", tags = ["manual"])— compiled but never auto-run bybazel test //...sh_test(name = "failure_propagation_test")— executes the binary directly (no Bazel-in-Bazel)rlocationpath+runfiles.bash v3for cross-platform binary path resolutionCross-platform
rules_shellv0.8.0 forsh_test(required since Bazel 9.x removed native sh_test)@rules_shell//shell/runfilesfor portable path resolutionCI
Adds a new step to the test matrix: "Failure propagation test (e2e)" — runs
bazel test //...ine2e/failure_propagation/across all 4 OS × 3 Bazel combinations.Verification
bazel test //...ine2e/failure_propagation: PASSED locallypre-commit run --all-files: all checks passbazel build //...: unaffected (.bazelignoreupdated)Checklist