Skip to content

Commit 3160d2f

Browse files
committed
test(emit): pin the scoreboard ERROR row recipe against real upstream bytes
The Kokkos recipe behind the one ERROR row uses annotated bare-string checksums, the shape fixed earlier, not one of the shapes this issue found rejected. Pinning it as a fixture from the merge-base bytes proves the case emits rather than leaving that to a re-score with a binary nobody can hand back under the current build-host gate.
1 parent eeedc74 commit 3160d2f

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

‎src/eb_emit.rs‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,26 @@ sources = [SOURCELOWER_TAR_BZ2]
13521352
checksums = [
13531353
{'openmpi-5.0.3.tar.bz2': ('sha256', '990582f206b3ab32e938aa31bbf07c639368e4405dca196fabe7f0f76eeda90b')},
13541354
]
1355+
";
1356+
1357+
/// The recipe behind the scoreboard's one ERROR row, reduced to the fields
1358+
/// that drive the rewrite. Bytes taken from
1359+
/// `easybuild/easyconfigs/k/Kokkos/Kokkos-4.7.01-GCC-14.3.0.eb` at
1360+
/// easybuild-easyconfigs 7cab6860, the merge-base of PR #25938: annotated
1361+
/// bare-string checksums, source plus one patch.
1362+
const KOKKOS_ANNOTATED_BARE_CHECKSUMS: &str = "\
1363+
name = 'Kokkos'
1364+
version = '4.7.01'
1365+
toolchain = {'name': 'GCC', 'version': '14.3.0'}
1366+
homepage = 'https://github.com/kokkos/kokkos'
1367+
sources = [{'download_filename': '%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}]
1368+
patches = ['Kokkos-4.7.01_fix-missing-check-include-cxx.patch']
1369+
checksums = [
1370+
# Kokkos-4.7.01.tar.gz
1371+
'cebf6daeb99c95e3d4116ea0d97c94b6a521c0cff1f5e613f127f6beea960ac7',
1372+
# Kokkos-4.7.01_fix-missing-check-include-cxx.patch
1373+
'ef8bb57088970fb765acd00bee6d9a07b52383b5e890feb7679bdff3cb1ad0db',
1374+
]
13551375
";
13561376

13571377
/// A form no EasyBuild version accepts, to pin the error message.
@@ -1582,6 +1602,45 @@ checksums = [
15821602
}
15831603
}
15841604

1605+
#[test]
1606+
fn the_kokkos_error_row_recipe_emits_a_file() {
1607+
// The scoreboard's only ERROR row. Emitting at all is the property under
1608+
// test: scoring it against the merged target needs a built binary and
1609+
// the target file, which this test cannot supply.
1610+
let params = EmitParams {
1611+
toolchain: Toolchain {
1612+
name: "GCC".into(),
1613+
version: "15.2.0".into(),
1614+
},
1615+
version: Some("5.1.1".into()),
1616+
dep_versions: HashMap::new(),
1617+
dep_toolchains: HashMap::new(),
1618+
source_checksum: Some(NEW_SHA.into()),
1619+
};
1620+
let r = emit_next_generation(KOKKOS_ANNOTATED_BARE_CHECKSUMS, &params).expect("emit");
1621+
assert_eq!(r.filename, "Kokkos-5.1.1-GCC-15.2.0.eb");
1622+
assert!(r.text.contains(&format!("'{NEW_SHA}'")), "{}", r.text);
1623+
// The patch hash below the second annotation is not the source's to take.
1624+
assert!(
1625+
r.text
1626+
.contains("'ef8bb57088970fb765acd00bee6d9a07b52383b5e890feb7679bdff3cb1ad0db'"),
1627+
"{}",
1628+
r.text
1629+
);
1630+
// Annotations are the maintainer's, and survive verbatim.
1631+
assert!(
1632+
r.text.contains(" # Kokkos-4.7.01.tar.gz\n"),
1633+
"{}",
1634+
r.text
1635+
);
1636+
// A version bump still owes a patch-set review.
1637+
assert!(
1638+
r.warnings.iter().any(|w| w.contains("patches")),
1639+
"warnings: {:?}",
1640+
r.warnings
1641+
);
1642+
}
1643+
15851644
#[test]
15861645
fn quoted_tokens_ignores_delimiters_inside_strings() {
15871646
let toks = quoted_tokens("('sha256', 'ab)cd')");

0 commit comments

Comments
 (0)