Repository navigation
test(id): prove source-only startup refuses without a compiler (#796 9-7) - #12524
Merged
Merged
Conversation
…9-7) Whole-startup proving test for inventory item 9-7: the real binary running the real serve path exits nonzero naming the missing Roc compiler when --world-source-only has no compiler configured, and a control with a minimal configured platform starts. The guard sits deep in cmd_serve (after store and endpoint open), so only a startup run substantiates it — parse-level and helper-level checks cannot.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Problem
#796 inventory item 9-7 — "source-only requires a configured compiler" — was the one explicitly unproven item left in the phase-9/10 verification debt. The guard exists in
cmd_serve(crates/id-cli/src/commands/serve.rs:ensure!(!world_source_only || compiler.is_some(), …)), but nothing substantiated it: the existing source-only tests are parse-level (cli/tests.rs) and raw-module policy tests, and the issue's own note warns a pure-helper unit test would not substantiate whole-startup acceptance — the guard sits deep incmd_serve, after the store and endpoint open.Change (test-only, +103 lines in
pkgs/id/tests/cli_integration.rs)Two whole-startup tests in
serve_tests, both running the real binary through the realservepath in a hermetic temp dir (--ephemeral --no-relay --no-gossip --no-mdns):test_serve_source_only_without_compiler_is_refused_at_startup— the 9-7 oracle.ID_ROC_PLATFORM/ID_ROC_BINare stripped and the working directory holds no conventionalexamples/roc-world, so compiler resolution finds nothing. Asserts startup exits non-zero and stderr names the guard:--world-source-only requires a configured Roc compiler and platform.test_serve_source_only_with_compiler_configured_starts— the control. A minimal fabricated platform directory (platform.roc+targets/wasm32/host.wasm, allCompiler::newasks for) is passed via--roc-platform; the same startup comes up and reports its node id, with the guard message absent. The pair pins the refusal on the missing compiler, not on source-only mode itself.No production code changed; the guard was not buggy.
Test evidence (sandbox venue; see caveat)
cargo test --test cli_integration test_serve_source_only→ 2 passed, 0 failed (11.60s of test time). Manual probes of the built binary agree: refusal exits 1 in ~1.1s with the guard message on stderr; the configured control printsnode: <id>and serves.true→ the refusal test FAILED (120.13s): the unguarded server started and kept serving until the test's deadline killed it, and the assertion tripped on the absent guard message. Scratch removed afterwards; nogit stashused.rustfmt --checkclean on the touched file.cli_integrationtarget was not run to completion locally — the sandbox's debug-link thrash (concurrent ~1 GB links across lanes, plus two VM reboots mid-run) made the full target impractical in this seat; all 138 tests in the target compiled as part of the targeted run. Per the repo's CI-first policy, the full target is exercised by CI on main.Refs #796 (item 9-7). Item 9-6 remains open on #796 and is not touched here.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.