Skip to content

Commit

Permalink
Add unified checksum path to snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Oct 22, 2024
1 parent f6437b5 commit ecb54bb
Show file tree
Hide file tree
Showing 49 changed files with 183 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cargo-dist/tests/gallery/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub struct AppResult {
homebrew_installer_path: Option<Utf8PathBuf>,
powershell_installer_path: Option<Utf8PathBuf>,
npm_installer_package_path: Option<Utf8PathBuf>,
unified_checksum_path: Option<Utf8PathBuf>,
}

pub struct PlanResult {
Expand Down Expand Up @@ -238,6 +239,7 @@ impl<'a> TestContext<'a, Tools> {
let homebrew_installer = Utf8PathBuf::from(format!("{target_dir}/{brew_app_name}.rb"));
let npm_installer =
Utf8PathBuf::from(format!("{target_dir}/{app_name}-npm-package.tar.gz"));
let unified_checksum_path = Utf8PathBuf::from(format!("{target_dir}/sha256.sum"));
app_results.push(AppResult {
test_name: test_name.to_owned(),
trust_hashes,
Expand All @@ -247,6 +249,9 @@ impl<'a> TestContext<'a, Tools> {
powershell_installer_path: ps_installer.exists().then_some(ps_installer),
homebrew_installer_path: homebrew_installer.exists().then_some(homebrew_installer),
npm_installer_package_path: npm_installer.exists().then_some(npm_installer),
unified_checksum_path: unified_checksum_path
.exists()
.then_some(unified_checksum_path),
})
}

Expand Down
8 changes: 8 additions & 0 deletions cargo-dist/tests/gallery/dist/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ impl DistResult {
.unwrap_or_default(),
app.npm_installer_package_path.as_deref(),
)?;
append_snapshot_file(
&mut snapshots,
app.unified_checksum_path
.as_deref()
.and_then(|p| p.file_name())
.unwrap_or_default(),
app.unified_checksum_path.as_deref(),
)?;
}

Ok(Snapshots {
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/akaikatana_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,9 @@ try {
exit 1
}

================ sha256.sum ================
142e0662b2d165342ba462d51c6b360f0385d0ac2cd1777cead765f15b63fc5c source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/akaikatana_musl.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,9 @@ downloader() {

download_binary_and_run_installer "$@" || exit 1

================ sha256.sum ================
142e0662b2d165342ba462d51c6b360f0385d0ac2cd1777cead765f15b63fc5c source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1807,6 +1807,9 @@ try {
exit 1
}

================ sha256.sum ================
142e0662b2d165342ba462d51c6b360f0385d0ac2cd1777cead765f15b63fc5c source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,9 @@ try {
exit 1
}

================ sha256.sum ================
142e0662b2d165342ba462d51c6b360f0385d0ac2cd1777cead765f15b63fc5c source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/akaikatana_updaters.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,9 @@ try {
exit 1
}

================ sha256.sum ================
142e0662b2d165342ba462d51c6b360f0385d0ac2cd1777cead765f15b63fc5c source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_abyss.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
f34166ec8dd84f6cfa6643733e1de538539355efc00aea53fbda263cd61a2ecc axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
6638c24608479e3e35caa69fc77fc1721e8517a4c9410e917863bec44f7f8131 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_alias.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3246,6 +3246,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
c3f52004f440435da76b054d4113132ff205f4c116b798c6a05f61ad987e7887 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3248,6 +3248,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
187b40c83319610de250f5e5b471ee89bd0fd50ea67b7d78fc51f70fd26ffbf2 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
caf7276a521e32a73149a5843d9922919a92f5269336fd5f6bc35d38b22a5cc3 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
11 changes: 11 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3217,6 +3217,17 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 axolotlsay-aarch64-apple-darwin.pkg
8c03c4bdf1e8745f82d9c197a340dca2668a89e4529e57f7bc4d7eec7e000233 axolotlsay-aarch64-apple-darwin.tar.gz
46c543bc15c20d554e51d9a87b02886c9987872a74c5d82e36acb64bbc39ccc4 axolotlsay-npm-package.tar.gz
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 axolotlsay-x86_64-apple-darwin.pkg
9b09a4896a0f7c68a9ce9619ebc0b2e07a351d6a673136ce79b61ebae21cfeb6 axolotlsay-x86_64-apple-darwin.tar.gz
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 axolotlsay-x86_64-pc-windows-msvc.msi
f54e3eedbd9a7a3fc7966b7706d3ec07f0fb864a3a8ee54d88fa0832f12731fd axolotlsay-x86_64-pc-windows-msvc.tar.gz
90eea05ca3752335cdcd512dfdc334695b843558b70de8a50201b901881a491d axolotlsay-x86_64-unknown-linux-gnu.tar.gz
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
0142dc6c05af98c9084c67115be3bceb24fecbc7d6783e039e3c919d48c3d32a axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class AxolotlBrew < Formula
end
end

================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,9 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
34cbcf6643c823f6561caa84f9e076d16ced08dedf060b4fef79320f11149105 axolotlsay-npm-package.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_dispatch.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
cb4dfeb71c4e5451146c3fb40078f72af97528972dfc132ba2e6242d65839f46 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,9 @@ try {
exit 1
}

================ sha256.sum ================
75d8c6cbd1ddf538fc8fb63d2b29e0db7789ce11b58e3332733dd9faed50b709 source.tar.gz

================ axolotlsay-installer.sh ================
#!/bin/sh
# shellcheck shell=dash
Expand Down Expand Up @@ -3551,6 +3554,9 @@ try {
exit 1
}

================ sha256.sum ================
75d8c6cbd1ddf538fc8fb63d2b29e0db7789ce11b58e3332733dd9faed50b709 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
ec6c1d3848961e9d897c8793a104197606552353c12d46a7bc802008806ff913 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_musl.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
e6f853f440cd8ea358c2d38f779ba9a4ddd3fe888df5ea3f082c289c1a108d24 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
280baf2981584566fce75a57b28f5075b59b6b1307b9b2181335397e023b0b37 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
f8dc27cab7338ad359e28eef70d66b7fe0239e975308f5cde10076e035842f34 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_no_locals.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3252,6 +3252,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
89116b2b5e7bd5c40dfdbff30d36e5233ff953ec79a01cbbca68d9e94b685cf5 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,9 @@ try {
exit 1
}

================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,9 @@ try {
exit 1
}

================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
3 changes: 3 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source: cargo-dist/tests/gallery/dist/snapshot.rs
expression: self.payload
---
================ sha256.sum ================
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_updaters.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3222,6 +3222,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
475b4625fca3e213ab8a38fcb887afdacca13f625decf251005481770bcf91e3 axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,10 @@ install(false);
const { run } = require("./binary");
run("axolotlsay");

================ sha256.sum ================
f0674e45ffa2f8d4bb30718534aaf25c79acc9133c87d80d65fc5debdefacd7e axolotlsay-npm-package.tar.gz
6dd3a33b92c3c35b05d8b4c350e7600d9db3f000e402ac0bf226859ec6b0c984 source.tar.gz

================ dist-manifest.json ================
{
"dist_version": "CENSORED",
Expand Down
Loading

0 comments on commit ecb54bb

Please sign in to comment.