Cut 17: the checkout-detecting test no longer asserts against Idunn's own gate (PA.f194-C)
`vendor_eve_git_checkout_available_distinguishes_a_checkout_from_a_copy` asserted its positive case unconditionally whenever `git` is on PATH. Idunn's own gate (`cargo test --locked -p ghostlight-dungeon --bin ghostlight-dungeon`, the exact command the Yggdrasil runbook documents) materializes `vendor/eve` byte-for-byte from the Git object store (`Idunn::drivers::materialize_tree_raw`/`materialize_gitlink_raw`, confirmed by reading `F:\Projects\Idunn\src\drivers.rs`) and that writer refuses to ever write `.git` metadata, on the main tree or any Gitlink. So inside Idunn's own gate `vendor/eve` is unconditionally a copy, not a checkout — exactly the shape this test's own negative case proves unavailable — and the positive assertion failed the gate for a reason unrelated to the code under test. The positive case now checks `vendor/eve/.git` directly (ground truth independent of the function under test) and skips with a named reason when it is absent, asserting only when a real checkout is actually present. Verified: forcing that check to report absent reproduces Idunn's exact condition and the test now reports SKIPPED instead of failing; reverted after. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
6f9a1351a4
commit
abb84b49f2
1 changed files with 37 additions and 6 deletions
|
|
@ -3277,20 +3277,51 @@ mod tests {
|
|||
/// `vendor/eve` that is present but not a checkout (this test's own
|
||||
/// `copied` case) would then still report "available", exactly the shape
|
||||
/// Soul hit by accident and this test's own negative assertion catches.
|
||||
///
|
||||
/// PA.f194-C: the positive case is gated on `vendor/eve/.git` actually
|
||||
/// existing, not merely on `git` being on `PATH`. Idunn's own frozen-
|
||||
/// source gate (`cargo test --locked -p ghostlight-dungeon --bin
|
||||
/// ghostlight-dungeon`, the exact command this repo's Yggdrasil runbook
|
||||
/// documents) materializes both the main tree and every Gitlink —
|
||||
/// `vendor/eve` included — byte for byte from the Git object store
|
||||
/// (`Idunn::drivers::materialize_tree_raw`/`materialize_gitlink_raw`),
|
||||
/// and that writer refuses to ever write `.git` metadata
|
||||
/// ("Git tree contains forbidden .git metadata", enforced on both the
|
||||
/// main tree and every Gitlink target). So inside Idunn's own gate,
|
||||
/// `vendor/eve` is unconditionally the "copied, not cloned" shape this
|
||||
/// test's negative case below proves unavailable — not a bug in the
|
||||
/// check, and not a shape this test's positive case should assert
|
||||
/// against. Checking `vendor/eve/.git` directly, rather than trusting
|
||||
/// `vendor_eve_git_checkout_available`'s own verdict, keeps this
|
||||
/// ground truth independent of the function under test.
|
||||
#[test]
|
||||
fn vendor_eve_git_checkout_available_distinguishes_a_checkout_from_a_copy() {
|
||||
// The real repo root: `vendor/eve` here is a genuine git checkout
|
||||
// (pinned submodule), so this must report true whenever `git` itself
|
||||
// is on `PATH` — the same precondition every other check in this
|
||||
// module already assumes.
|
||||
// The real repo root: on a normal developer checkout `vendor/eve` is
|
||||
// a genuine git checkout (pinned submodule, `.git` is a gitlink file
|
||||
// pointing at the superproject's `.git/modules/...`), so this must
|
||||
// report true whenever `git` itself is on `PATH`. Inside Idunn's own
|
||||
// frozen-source gate `vendor/eve` carries no `.git` at all by design
|
||||
// (see the PA.f194-C doc comment above) — that is exactly the copy
|
||||
// shape this test's negative case proves unavailable, so the positive
|
||||
// assertion is skipped there instead of failing the gate.
|
||||
let vendor_eve_has_git_metadata = repo_root().join("vendor").join("eve").join(".git").exists();
|
||||
let git_on_path = std::process::Command::new("git")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.is_ok_and(|output| output.status.success());
|
||||
if git_on_path {
|
||||
if !vendor_eve_has_git_metadata {
|
||||
eprintln!(
|
||||
"SKIPPED vendor_eve_git_checkout_available_distinguishes_a_checkout_from_a_copy's own \
|
||||
positive case: vendor/eve/.git does not exist here. Inside Idunn's own frozen-source \
|
||||
gate this is expected (PA.f194-C, see the doc comment above) — the writer that \
|
||||
materializes vendor/eve there deliberately never writes .git metadata. On a normal \
|
||||
developer checkout this means the vendor/eve submodule was never initialized; run \
|
||||
`git submodule update --init vendor/eve`."
|
||||
);
|
||||
} else if git_on_path {
|
||||
assert!(
|
||||
vendor_eve_git_checkout_available(&repo_root()),
|
||||
"the real vendor/eve submodule checkout must report available"
|
||||
"vendor/eve carries .git metadata but still reports unavailable"
|
||||
);
|
||||
} else {
|
||||
eprintln!(
|
||||
|
|
|
|||
Loading…
Reference in a new issue