Skip to content

Commit 0167c0b

Browse files
committed
Assert pnpm group-commit revert drops scaffold
The group-commit round-trip test exempted pnpm from the byte-exact check because a two-package revert left the emptied pnpm.overrides and the scaffolded pnpm-workspace.yaml behind (#636). Now that both are removed, say why pnpm is still exempt (the fixture's minified package.json comes back re-indented) and assert the scaffold is gone. Assisted-by: Claude Code:claude-opus-5-5
1 parent 8212cc8 commit 0167c0b

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

‎crates/socket-patch-cli/tests/vendor_group_commit_e2e.rs‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,22 @@ fn group_commit_ends_where_per_package_commits_end_for_every_ecosystem() {
113113
masked_tree(&oracle.root),
114114
"{eco}: same tree after --revert"
115115
);
116-
// Two ecosystems keep scaffolding their revert does not remove when
117-
// TWO packages were vendored (the emptied pnpm override tables and
118-
// workspace file; the catch-all `<packageSourceMapping>` nuget adds
119-
// to a config that had none). That predates the group commit — the
120-
// oracle leaves the same bytes, asserted just above — so only the
121-
// others are held to a byte-exact round trip here.
116+
// Two ecosystems do not round-trip byte for byte when TWO packages
117+
// were vendored: pnpm rewrites the fixture's minified package.json
118+
// with an indent, and nuget keeps the catch-all
119+
// `<packageSourceMapping>` it adds to a config that had none. That
120+
// predates the group commit — the oracle leaves the same bytes,
121+
// asserted just above — so only the others are held to a
122+
// byte-exact round trip here. pnpm's created scaffold itself is
123+
// gone (#636): no emptied `pnpm.overrides`, no workspace file.
124+
if *eco == "pnpm" {
125+
assert!(
126+
!grouped.root.join("pnpm-workspace.yaml").exists(),
127+
"pnpm: the scaffolded workspace file is removed"
128+
);
129+
let pkg = std::fs::read_to_string(grouped.root.join("package.json")).unwrap();
130+
assert!(!pkg.contains("\"pnpm\""), "pnpm: {pkg}");
131+
}
122132
if !["pnpm", "nuget"].contains(eco) {
123133
let after = masked_tree(&grouped.root);
124134
assert!(

0 commit comments

Comments
 (0)