Skip to content

Commit

Permalink
test: bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
evilrobot-01 committed Dec 18, 2024
1 parent e1adb0c commit 82e1322
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 51 deletions.
6 changes: 3 additions & 3 deletions crates/pop-parachains/src/up/chain_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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?
Expand All @@ -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?
Expand Down
61 changes: 29 additions & 32 deletions crates/pop-parachains/src/up/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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(())
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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(())
Expand All @@ -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,
Expand All @@ -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(())
Expand All @@ -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(())
}
Expand All @@ -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(())
}
Expand All @@ -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,
Expand Down Expand Up @@ -952,15 +951,14 @@ id = 1000
chain = "asset-hub-paseo-local"
"#
)?;
let version = "v1.12.0";

let zombienet = Zombienet::new(
&cache,
config.path().to_str().unwrap(),
None,
None,
None,
Some(version),
Some(VERSION),
None,
)
.await?;
Expand All @@ -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(())
}
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 7 additions & 9 deletions crates/pop-parachains/src/up/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -159,7 +159,7 @@ mod tests {
"polkadot",
None,
None,
"v1.12.0",
VERSION,
Some("asset-hub-paseo-local"),
tempdir()?.path()
)
Expand All @@ -170,21 +170,20 @@ 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);
assert!(matches!(parachain.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: vec![(expected.binary(), None)],
Expand All @@ -196,21 +195,20 @@ 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);
assert!(matches!(parachain.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: vec![(expected.binary(), None)],
Expand All @@ -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()?;
Expand Down
14 changes: 7 additions & 7 deletions crates/pop-parachains/src/up/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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?;
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 82e1322

Please sign in to comment.