From 628f967a57d2c4da5e2af6496a22df2d98539467 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Tue, 26 Mar 2024 14:29:15 +0000 Subject: [PATCH 1/2] Update the insta dependency to 1.37 --- Cargo.lock | 14 ++------------ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2d6d05f836..7f409565670 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2767,9 +2767,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.34.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +checksum = "1718b3f2b85bb5054baf8ce406e36401f27c3169205f4175504c4b1d98252d3f" dependencies = [ "console", "lazy_static", @@ -2778,7 +2778,6 @@ dependencies = [ "pest_derive", "serde", "similar", - "yaml-rust", ] [[package]] @@ -8521,15 +8520,6 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yansi" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 01f706b667b..d7abc7a388b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -185,7 +185,7 @@ hyper-tls = "0.5.0" im = "15" indexmap = "1.6" indicatif = { version = "0.15.0", features = ["with_rayon"] } -insta = { version = "1.34.0", features = ["json", "yaml", "redactions"] } +insta = { version = "1.37.0", features = ["json", "yaml", "redactions"] } integration-tests = { path = "integration-tests" } itertools = "0.10.0" itoa = "1.0" From 2fdaa55e9272fe0e9bf4093e1f2dde82a75b75d0 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Tue, 26 Mar 2024 14:29:44 +0000 Subject: [PATCH 2/2] assert_display_snapshot is deprecated, use assert_snapshot instead --- chain/chain/src/tests/simple_chain.rs | 8 ++++---- core/parameters/src/config_store.rs | 2 +- core/store/src/db/colddb.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chain/chain/src/tests/simple_chain.rs b/chain/chain/src/tests/simple_chain.rs index 5fce22e8d41..be2edcc8999 100644 --- a/chain/chain/src/tests/simple_chain.rs +++ b/chain/chain/src/tests/simple_chain.rs @@ -33,9 +33,9 @@ fn build_chain() { // cargo insta test --accept -p near-chain --features nightly -- tests::simple_chain::build_chain let hash = chain.head().unwrap().last_block_hash; if cfg!(feature = "nightly") { - insta::assert_display_snapshot!(hash, @"Dnn7UkUiRfMu13jheAbcoJvQ66gKBgAoynRdEkMTkX58"); + insta::assert_snapshot!(hash, @"Dnn7UkUiRfMu13jheAbcoJvQ66gKBgAoynRdEkMTkX58"); } else { - insta::assert_display_snapshot!(hash, @"EsUNazp4zR2XgiwZSuQnX9dsaFk1VDhdRwGYt1YHpu5b"); + insta::assert_snapshot!(hash, @"EsUNazp4zR2XgiwZSuQnX9dsaFk1VDhdRwGYt1YHpu5b"); } for i in 1..5 { @@ -51,9 +51,9 @@ fn build_chain() { let hash = chain.head().unwrap().last_block_hash; if cfg!(feature = "nightly") { - insta::assert_display_snapshot!(hash, @"8xU6fbbdGeYmQRaAbsszMHDM88KSAaniHykowTUDYXpm"); + insta::assert_snapshot!(hash, @"8xU6fbbdGeYmQRaAbsszMHDM88KSAaniHykowTUDYXpm"); } else { - insta::assert_display_snapshot!(hash, @"CJ5p62dVTMVgRADQrWPkFLrozDN8KxbKMGqjVkPXBD7W"); + insta::assert_snapshot!(hash, @"CJ5p62dVTMVgRADQrWPkFLrozDN8KxbKMGqjVkPXBD7W"); } } diff --git a/core/parameters/src/config_store.rs b/core/parameters/src/config_store.rs index 2a46438755e..e0cf6d18a2f 100644 --- a/core/parameters/src/config_store.rs +++ b/core/parameters/src/config_store.rs @@ -351,7 +351,7 @@ mod tests { omit_expression => true, }, { any_failure |= std::panic::catch_unwind(|| { - insta::assert_display_snapshot!("parameters", params); + insta::assert_snapshot!("parameters", params); }).is_err(); }); } diff --git a/core/store/src/db/colddb.rs b/core/store/src/db/colddb.rs index 7cc299d9bd9..757c4bcd63e 100644 --- a/core/store/src/db/colddb.rs +++ b/core/store/src/db/colddb.rs @@ -272,7 +272,7 @@ mod test { // Check expected value. Use cargo-insta to update the expected value: // cargo install cargo-insta // cargo insta test --accept -p near-store -- db::colddb - insta::assert_display_snapshot!(result.join("\n"), @r###" + insta::assert_snapshot!(result.join("\n"), @r###" State `ShardUId || 11111111111111111111111111111111` [cold] get_raw_bytes → FooBar; rc: 1 [cold] get_with_rc_stripped → FooBar @@ -318,7 +318,7 @@ mod test { // Check expected value. Use cargo-insta to update the expected value: // cargo install cargo-insta // cargo insta test --accept -p near-store -- db::colddb - insta::assert_display_snapshot!(result.join("\n"), @r###" + insta::assert_snapshot!(result.join("\n"), @r###" State [cold] (`ShardUId || 11111111111111111111111111111111`, FooBar) [raw ] (`ShardUId || 11111111111111111111111111111111`, FooBar)