Skip to content

Commit

Permalink
fix: conflicting tests merged to one
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwht committed Dec 18, 2024
1 parent 72b404c commit ca1e622
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions crates/pop-cli/src/commands/up/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,20 @@ mod tests {
}

#[tokio::test]
async fn get_upload_call_data_works() -> anyhow::Result<()> {
async fn get_upload_and_instantiate_call_data_works() -> anyhow::Result<()> {
let (contracts_node_process, port, temp_dir) = start_test_environment().await?;
let localhost_url = format!("ws://127.0.0.1:{}", port);
sleep(Duration::from_secs(20)).await;
sleep(Duration::from_secs(5)).await;

get_upload_call_data_works(port, temp_dir).await?;

// Stop running contracts-node
stop_test_environment(&contracts_node_process.id().to_string())?;
Ok(())
}

async fn get_upload_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> {
let localhost_url = format!("ws://127.0.0.1:{}", port);

let up_contract_opts = UpContractCommand {
path: Some(temp_dir.path().join("testing")),
Expand Down Expand Up @@ -528,17 +538,11 @@ mod tests {

// Retrieved call data and calculated match.
assert_eq!(retrieved_call_data, encoded_expected_call_data);

// Stop running contracts-node
stop_test_environment(&contracts_node_process.id().to_string())?;
Ok(())
}

#[tokio::test]
async fn get_instantiate_call_data_works() -> anyhow::Result<()> {
let (contracts_node_process, port, temp_dir) = start_test_environment().await?;
async fn get_instantiate_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> {
let localhost_url = format!("ws://127.0.0.1:{}", port);
sleep(Duration::from_secs(20)).await;

let up_contract_opts = UpContractCommand {
path: Some(temp_dir.path().join("testing")),
Expand Down Expand Up @@ -575,8 +579,6 @@ mod tests {
// Retrieved call data matches the one crafted above.
assert_eq!(retrieved_call_data, expected_call_data);

// Stop running contracts-node
stop_test_environment(&contracts_node_process.id().to_string())?;
Ok(())
}
}

0 comments on commit ca1e622

Please sign in to comment.