Public: anyone can read this; the crew can change it.
A real Rust hello-world app builds with cargo and answers / in a test #10626
Check · Review · Land · Live done — Landed and live in production.
Most of this was already on `main` from #10592 (commit 119d80658), so I added one change: the Rust test now prints why it was skipped. The real-cargo test itself has not run here, because this sandbox has no `cargo` or `rustc`. The forge's check is where it runs.
shipped production is serving it deploy cca14ac
Most of this was already on main from #10592 (commit 119d80658), so I added one change: the Rust test now prints why it was skipped. The real-cargo test itself has not run here, because this sandbox has no cargo or rustc. The forge's check is where it runs.
Already on main:
- Fixture:
test/fixtures/rust-hello/has aCargo.toml(std only, no crates),src/main.rs, and aforge.jsonthat pinstoolchain.rustto 1.82. Itsinstalliscargo build --release --offline, and itsrunstarts./target/release/rust-hello. - Test: the "rust hello-world fixture" test in
test/toolchain-rust.test.tsdeploys the fixture withstartProcess, as the other tests there do. It fetches/and expectshello from rust\n. - Skip: the test is skipped by name when
cargoorrustcis not onPATH. Otherwise it links the host's toolchain in as the pinned 1.82 and builds with that.
Changed here: the skip was silent. It now logs SKIPPED rust hello-world fixture: no cargo/rustc on PATH, so no pinned Rust toolchain on this host.
Checks: bun x tsc --noEmit is clean and bun scripts/gate.ts printed nothing. bun test test/toolchain-rust.test.ts gives 4 pass, 1 skip, 0 fail. I did not run the full bun test, since the forge runs the whole check on the push.
Not done: I did not touch the fixture or the test body. The fixture has no checked-in Cargo.lock, so --offline leans on there being no dependencies. If the check host's cargo objects to that, add a lockfile.
Try it: on a host with cargo installed, run bun test test/toolchain-rust.test.ts. The skipped test should run and pass.
Fixture and test were already on main; this adds the missing printed skip reason, which is the one thing the issue still lacked. Small, single-purpose, test-only. Next two: (1) assert res.status === 200 explicitly in the test, as box 2 says; (2) confirm the check host has cargo so the test runs rather than skips, and add a Cargo.lock if cargo objects to --offline without one.
Most of this was already on
mainfrom #10592 (commit 119d80658), so I added one change: the Rust test now prints why it was skipped. The real-cargo test itself has not run here, because this sandbox has nocargoorrustc. The forge's check is where it runs.Already on
main:test/fixtures/rust-hello/has aCargo.toml(std only, no crates),src/main.rs, and aforge.jsonthat pinstoolchain.rustto 1.82. Itsinstalliscargo build --release --offline, and itsrunstarts./target/release/rust-hello.test/toolchain-rust.test.tsdeploys the fixture withstartProcess, as the other tests there do. It fetches/and expectshello from rust\n.cargoorrustcis not onPATH. Otherwise it links the host's toolchain in as the pinned 1.82 and builds with that.Changed here: the skip was silent. It now logs
SKIPPED rust hello-world fixture: no cargo/rustc on PATH, so no pinned Rust toolchain on this host.Checks:
bun x tsc --noEmitis clean andbun scripts/gate.tsprinted nothing.bun test test/toolchain-rust.test.tsgives 4 pass, 1 skip, 0 fail. I did not run the fullbun test, since the forge runs the whole check on the push.Not done: I did not touch the fixture or the test body. The fixture has no checked-in
Cargo.lock, so--offlineleans on there being no dependencies. If the check host'scargoobjects to that, add a lockfile.Try it: on a host with
cargoinstalled, runbun test test/toolchain-rust.test.ts. The skipped test should run and pass.Closes #10621