diff options
Diffstat (limited to 'tests/world.rs')
| -rw-r--r-- | tests/world.rs | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/tests/world.rs b/tests/world.rs index 8229d62..3a7dd54 100644 --- a/tests/world.rs +++ b/tests/world.rs @@ -1,14 +1,3 @@ -//! `.PKGINFO` / `.BUILDINFO` parsing and the world snapshot (§10.1, I12). -//! -//! The world snapshot is the whole basis of staleness: "would rebuilding this -//! change what a consumer gets?" only means something if we recorded, at build -//! time, the exact set of our packages the build saw. Two properties matter and -//! are tested here — that the record comes from the archive rather than from -//! anything the build asserted about itself, and that it is intersected with our -//! own index **at ingest time**, because an unfiltered `.BUILDINFO` would make -//! every package permanently stale (Arch never stops moving) and the Attention -//! page would be noise forever. - mod common; use aur_build::db; @@ -17,8 +6,7 @@ use aur_build::pkginfo; use common::*; /// Build a real `.pkg.tar.zst`: zstd-compressed tar with the two metadata files -/// inside, exactly as makepkg lays them out. `None` for either means the file is -/// absent from the archive. +/// inside, as makepkg lays them out. `None` means the file is absent. fn make_archive(dir: &std::path::Path, name: &str, pkginfo: Option<&str>, buildinfo: Option<&str>) -> std::path::PathBuf { let path = dir.join(format!("{name}.pkg.tar.zst")); let enc = std::io::BufWriter::new(std::fs::File::create(&path).unwrap()); @@ -132,15 +120,13 @@ fn the_world_snapshot_is_intersected_with_our_index_at_ingest_time() { // §10.1 / I12. The fixture's build root contains glibc, pacman, binutils and // plain-make; only plain-make is ours, and only plain-make may be recorded. let (env, fx) = env_with_fixture("plain-make"); - // The first build has no world of ours to record — nothing we publish exists - // yet. That is the honest answer, not an empty lie about glibc. + // The first build has no world of ours to record — the honest answer, not an + // empty lie about glibc. publish(&env, "plain-make"); let first = world_of_last_build(&env); assert!(first.is_empty(), "nothing of ours existed for the first build: {first:?}"); - // Now plain-make is in the index, so a later build records it and nothing - // else. A real chroot with our repo enabled has the previous version of the - // package installed; the manifest says the same. + // Now plain-make is in the index, so a later build records it and nothing else. let mut manifest = fx.manifest_json(); manifest["installed"] = serde_json::json!([ { "name": "glibc", "version": "2.39-1", "arch": "x86_64" }, @@ -169,8 +155,7 @@ fn the_world_snapshot_is_intersected_with_our_index_at_ingest_time() { #[test] fn a_split_pkgbase_is_one_approval_and_many_index_rows() { - // §3: one recipe, several packages, one human decision. Every package the - // build produced gets its own index entry and its own artifact. + // §3: one recipe, several packages, one human decision. let (env, _fx) = env_with_fixture("split-pkgbase"); publish(&env, "split-pkgbase"); let rows: Vec<String> = env |
