From 82e1322e07fdd236a773e25beade01a33a2c0fae Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Wed, 18 Dec 2024 23:18:46 +0000 Subject: [PATCH] test: bump versions --- crates/pop-parachains/src/up/chain_specs.rs | 6 +- crates/pop-parachains/src/up/mod.rs | 61 ++++++++++----------- crates/pop-parachains/src/up/parachains.rs | 16 +++--- crates/pop-parachains/src/up/relay.rs | 14 ++--- 4 files changed, 46 insertions(+), 51 deletions(-) diff --git a/crates/pop-parachains/src/up/chain_specs.rs b/crates/pop-parachains/src/up/chain_specs.rs index 4e8ae686f..e81db7ee9 100644 --- a/crates/pop-parachains/src/up/chain_specs.rs +++ b/crates/pop-parachains/src/up/chain_specs.rs @@ -111,7 +111,7 @@ mod tests { #[tokio::test] async fn kusama_works() -> anyhow::Result<()> { let expected = Runtime::Kusama; - let version = "v1.2.7"; + let version = "v1.3.3"; let temp_dir = tempdir()?; let binary = chain_spec_generator("kusama-local", Some(version), temp_dir.path()) .await? @@ -135,7 +135,7 @@ mod tests { #[tokio::test] async fn paseo_works() -> anyhow::Result<()> { let expected = Runtime::Paseo; - let version = "v1.2.4"; + let version = "v1.3.4"; let temp_dir = tempdir()?; let binary = chain_spec_generator("paseo-local", Some(version), temp_dir.path()) .await? @@ -159,7 +159,7 @@ mod tests { #[tokio::test] async fn polkadot_works() -> anyhow::Result<()> { let expected = Runtime::Polkadot; - let version = "v1.2.7"; + let version = "v1.3.3"; let temp_dir = tempdir()?; let binary = chain_spec_generator("polkadot-local", Some(version), temp_dir.path()) .await? diff --git a/crates/pop-parachains/src/up/mod.rs b/crates/pop-parachains/src/up/mod.rs index 036ae889d..ba03efb5d 100644 --- a/crates/pop-parachains/src/up/mod.rs +++ b/crates/pop-parachains/src/up/mod.rs @@ -660,6 +660,8 @@ mod tests { use std::{env::current_dir, fs::File, io::Write}; use tempfile::tempdir; + pub(crate) const VERSION: &str = "stable2409"; + mod zombienet { use super::*; use pop_common::Status; @@ -683,12 +685,11 @@ mod tests { chain = "paseo-local" "# )?; - let version = "v1.12.0"; let zombienet = Zombienet::new( &cache, config.path().to_str().unwrap(), - Some(version), + Some(VERSION), None, None, None, @@ -698,12 +699,12 @@ chain = "paseo-local" let relay_chain = &zombienet.relay_chain.binary; assert_eq!(relay_chain.name(), "polkadot"); - assert_eq!(relay_chain.path(), temp_dir.path().join(format!("polkadot-{version}"))); - assert_eq!(relay_chain.version().unwrap(), version); + assert_eq!(relay_chain.path(), temp_dir.path().join(format!("polkadot-{VERSION}"))); + assert_eq!(relay_chain.version().unwrap(), VERSION); assert!(matches!( relay_chain, Binary::Source { source: Source::GitHub(ReleaseArchive { tag, .. }), .. } - if *tag == Some(version.to_string()) + if *tag == Some(VERSION.to_string()) )); assert!(zombienet.parachains.is_empty()); Ok(()) @@ -721,7 +722,7 @@ chain = "paseo-local" chain = "paseo-local" "# )?; - let version = "v1.2.7"; + let version = "v1.3.3"; let zombienet = Zombienet::new( &cache, @@ -761,15 +762,14 @@ chain = "paseo-local" r#" [relaychain] chain = "paseo-local" -default_command = "./bin-v1.6.0/polkadot" +default_command = "./bin-stable2409/polkadot" "# )?; - let version = "v1.12.0"; let zombienet = Zombienet::new( &cache, config.path().to_str().unwrap(), - Some(version), + Some(VERSION), None, None, None, @@ -779,12 +779,12 @@ default_command = "./bin-v1.6.0/polkadot" let relay_chain = &zombienet.relay_chain.binary; assert_eq!(relay_chain.name(), "polkadot"); - assert_eq!(relay_chain.path(), temp_dir.path().join(format!("polkadot-{version}"))); - assert_eq!(relay_chain.version().unwrap(), version); + assert_eq!(relay_chain.path(), temp_dir.path().join(format!("polkadot-{VERSION}"))); + assert_eq!(relay_chain.version().unwrap(), VERSION); assert!(matches!( relay_chain, Binary::Source { source: Source::GitHub(ReleaseArchive { tag, .. }), .. } - if *tag == Some(version.to_string()) + if *tag == Some(VERSION.to_string()) )); assert!(zombienet.parachains.is_empty()); Ok(()) @@ -807,12 +807,11 @@ validator = true command = "polkadot" "# )?; - let version = "v1.12.0"; let zombienet = Zombienet::new( &cache, config.path().to_str().unwrap(), - Some(version), + Some(VERSION), None, None, None, @@ -822,12 +821,12 @@ command = "polkadot" let relay_chain = &zombienet.relay_chain.binary; assert_eq!(relay_chain.name(), "polkadot"); - assert_eq!(relay_chain.path(), temp_dir.path().join(format!("polkadot-{version}"))); - assert_eq!(relay_chain.version().unwrap(), version); + assert_eq!(relay_chain.path(), temp_dir.path().join(format!("polkadot-{VERSION}"))); + assert_eq!(relay_chain.version().unwrap(), VERSION); assert!(matches!( relay_chain, Binary::Source { source: Source::GitHub(ReleaseArchive { tag, .. }), .. } - if *tag == Some(version.to_string()) + if *tag == Some(VERSION.to_string()) )); assert!(zombienet.parachains.is_empty()); Ok(()) @@ -852,14 +851,14 @@ command = "polkadot" [[relaychain.nodes]] name = "bob" validator = true -command = "polkadot-v1.12.0" +command = "polkadot-stable2409" "# )?; assert!(matches!( Zombienet::new(&cache, config.path().to_str().unwrap(), None, None, None, None, None).await, Err(Error::UnsupportedCommand(error)) - if error == "the relay chain command is unsupported: polkadot-v1.12.0" + if error == "the relay chain command is unsupported: polkadot-stable2409" )); Ok(()) } @@ -879,14 +878,14 @@ default_command = "polkadot" [[relaychain.nodes]] name = "alice" validator = true -command = "polkadot-v1.12.0" +command = "polkadot-stable2409" "# )?; assert!(matches!( Zombienet::new(&cache, config.path().to_str().unwrap(), None, None, None, None, None).await, Err(Error::UnsupportedCommand(error)) - if error == "the relay chain command is unsupported: polkadot-v1.12.0" + if error == "the relay chain command is unsupported: polkadot-stable2409" )); Ok(()) } @@ -907,12 +906,12 @@ id = 1000 chain = "asset-hub-paseo-local" "# )?; - let system_parachain_version = "v1.12.0"; + let system_parachain_version = "stable2407"; let zombienet = Zombienet::new( &cache, config.path().to_str().unwrap(), - Some("v1.11.0"), + Some(VERSION), None, Some(system_parachain_version), None, @@ -952,7 +951,6 @@ id = 1000 chain = "asset-hub-paseo-local" "# )?; - let version = "v1.12.0"; let zombienet = Zombienet::new( &cache, @@ -960,7 +958,7 @@ chain = "asset-hub-paseo-local" None, None, None, - Some(version), + Some(VERSION), None, ) .await?; @@ -972,13 +970,13 @@ chain = "asset-hub-paseo-local" assert_eq!(chain_spec_generator.name(), "paseo-chain-spec-generator"); assert_eq!( chain_spec_generator.path(), - temp_dir.path().join(format!("paseo-chain-spec-generator-{version}")) + temp_dir.path().join(format!("paseo-chain-spec-generator-{VERSION}")) ); - assert_eq!(chain_spec_generator.version().unwrap(), version); + assert_eq!(chain_spec_generator.version().unwrap(), VERSION); assert!(matches!( chain_spec_generator, Binary::Source { source: Source::GitHub(ReleaseArchive { tag, .. }), .. } - if *tag == Some(version.to_string()) + if *tag == Some(VERSION.to_string()) )); Ok(()) } @@ -1384,10 +1382,9 @@ chain = "paseo-local" chain = "paseo-local" "# )?; - let version = "v1.12.0"; - File::create(cache.join(format!("polkadot-{version}")))?; - File::create(cache.join(format!("polkadot-execute-worker-{version}")))?; - File::create(cache.join(format!("polkadot-prepare-worker-{version}")))?; + File::create(cache.join(format!("polkadot-{VERSION}")))?; + File::create(cache.join(format!("polkadot-execute-worker-{VERSION}")))?; + File::create(cache.join(format!("polkadot-prepare-worker-{VERSION}")))?; let mut zombienet = Zombienet::new( &cache, diff --git a/crates/pop-parachains/src/up/parachains.rs b/crates/pop-parachains/src/up/parachains.rs index f629c857e..ad6075454 100644 --- a/crates/pop-parachains/src/up/parachains.rs +++ b/crates/pop-parachains/src/up/parachains.rs @@ -148,7 +148,7 @@ pub(super) async fn from( #[cfg(test)] mod tests { - use super::*; + use super::{super::tests::VERSION, *}; use std::path::PathBuf; use tempfile::tempdir; @@ -159,7 +159,7 @@ mod tests { "polkadot", None, None, - "v1.12.0", + VERSION, Some("asset-hub-paseo-local"), tempdir()?.path() ) @@ -170,13 +170,12 @@ mod tests { #[tokio::test] async fn system_using_relay_version() -> anyhow::Result<()> { - let version = "v1.12.0"; let expected = Parachain::System; let para_id = 1000; let temp_dir = tempdir()?; let parachain = - system(para_id, expected.binary(), None, None, version, None, temp_dir.path()) + system(para_id, expected.binary(), None, None, VERSION, None, temp_dir.path()) .await? .unwrap(); assert_eq!(para_id, parachain.id); @@ -184,7 +183,7 @@ mod tests { if name == expected.binary() && source == Source::GitHub(ReleaseArchive { owner: "r0gue-io".to_string(), repository: "polkadot".to_string(), - tag: Some(version.to_string()), + tag: Some(VERSION.to_string()), tag_format: Some("polkadot-{tag}".to_string()), archive: format!("{name}-{}.tar.gz", target()?), contents: vec![(expected.binary(), None)], @@ -196,13 +195,12 @@ mod tests { #[tokio::test] async fn system_works() -> anyhow::Result<()> { - let version = "v1.12.0"; let expected = Parachain::System; let para_id = 1000; let temp_dir = tempdir()?; let parachain = - system(para_id, expected.binary(), Some(version), None, version, None, temp_dir.path()) + system(para_id, expected.binary(), Some(VERSION), None, VERSION, None, temp_dir.path()) .await? .unwrap(); assert_eq!(para_id, parachain.id); @@ -210,7 +208,7 @@ mod tests { if name == expected.binary() && source == Source::GitHub(ReleaseArchive { owner: "r0gue-io".to_string(), repository: "polkadot".to_string(), - tag: Some(version.to_string()), + tag: Some(VERSION.to_string()), tag_format: Some("polkadot-{tag}".to_string()), archive: format!("{name}-{}.tar.gz", target()?), contents: vec![(expected.binary(), None)], @@ -223,7 +221,7 @@ mod tests { #[tokio::test] async fn system_with_chain_spec_generator_works() -> anyhow::Result<()> { let expected = Parachain::System; - let runtime_version = "v1.2.7"; + let runtime_version = "v1.3.3"; let para_id = 1000; let temp_dir = tempdir()?; diff --git a/crates/pop-parachains/src/up/relay.rs b/crates/pop-parachains/src/up/relay.rs index 6a3a666f7..2390e446a 100644 --- a/crates/pop-parachains/src/up/relay.rs +++ b/crates/pop-parachains/src/up/relay.rs @@ -131,17 +131,18 @@ mod tests { use super::*; use tempfile::tempdir; + const VERSION: &str = "stable2409"; + #[tokio::test] async fn default_works() -> anyhow::Result<()> { let expected = RelayChain::Polkadot; - let version = "v1.12.0"; let temp_dir = tempdir()?; - let relay = default(Some(version), None, None, temp_dir.path()).await?; + let relay = default(Some(VERSION), None, None, temp_dir.path()).await?; assert!(matches!(relay.binary, Binary::Source { name, source, cache } if name == expected.binary() && source == Source::GitHub(ReleaseArchive { owner: "r0gue-io".to_string(), repository: "polkadot".to_string(), - tag: Some(version.to_string()), + tag: Some(VERSION.to_string()), tag_format: Some("polkadot-{tag}".to_string()), archive: format!("{name}-{}.tar.gz", target()?), contents: ["polkadot", "polkadot-execute-worker", "polkadot-prepare-worker"].map(|b| (b, None)).to_vec(), @@ -154,7 +155,7 @@ mod tests { #[tokio::test] async fn default_with_chain_spec_generator_works() -> anyhow::Result<()> { - let runtime_version = "v1.2.7"; + let runtime_version = "v1.3.3"; let temp_dir = tempdir()?; let relay = default(None, Some(runtime_version), Some("paseo-local"), temp_dir.path()).await?; @@ -186,15 +187,14 @@ mod tests { #[tokio::test] async fn from_handles_local_command() -> anyhow::Result<()> { let expected = RelayChain::Polkadot; - let version = "v1.12.0"; let temp_dir = tempdir()?; let relay = - from("./bin-v1.6.0/polkadot", Some(version), None, None, temp_dir.path()).await?; + from("./bin-stable2409/polkadot", Some(VERSION), None, None, temp_dir.path()).await?; assert!(matches!(relay.binary, Binary::Source { name, source, cache } if name == expected.binary() && source == Source::GitHub(ReleaseArchive { owner: "r0gue-io".to_string(), repository: "polkadot".to_string(), - tag: Some(version.to_string()), + tag: Some(VERSION.to_string()), tag_format: Some("polkadot-{tag}".to_string()), archive: format!("{name}-{}.tar.gz", target()?), contents: ["polkadot", "polkadot-execute-worker", "polkadot-prepare-worker"].map(|b| (b, None)).to_vec(),