Skip to content

Commit 60b14a1

Browse files
committed
Move tests
These tests used `assert_cmd::carg::cargo_bin`, which is deprecated. It is meant to be replaced with the macro `assert_cmd::cargo_bin!`, which required tests to be moved to the `cli` crate. If tests hadn't been moved, that macro would fail to find the binary, as the `CARGO_BIN_EXE_*` environment variable with the absolute path to a binary target’s executable would not have been set. Moving the tests causes it to be set, and the macro then works.
1 parent 95f9d37 commit 60b14a1

23 files changed

Lines changed: 7 additions & 4 deletions
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
// limitations under the License.
1717

1818
#![cfg(unix)]
19-
#![allow(deprecated)]
2019

2120
use std::{
2221
path::{Path, PathBuf},
2322
time::Duration,
2423
};
2524

26-
use assert_cmd::cargo::cargo_bin;
25+
use assert_cmd::cargo_bin;
2726
use frame_remote_externalities::{Builder, Mode, OfflineConfig, SnapshotConfig};
2827
use sp_runtime::{
2928
generic::{Block, Header},
@@ -43,7 +42,11 @@ async fn create_snapshot_works() {
4342
match common::start_node_inline(vec![
4443
"--no-hardware-benchmarks",
4544
"--dev",
45+
"--tmp",
4646
format!("--rpc-port={}", port).as_str(),
47+
"--no-telemetry",
48+
"--no-prometheus",
49+
"--rpc-max-response-size=1000", // Allow large RPC responses for snapshot creation
4750
]) {
4851
Ok(_) => {}
4952
Err(e) => {
@@ -52,7 +55,7 @@ async fn create_snapshot_works() {
5255
}
5356
});
5457
// Wait some time to ensure the node is warmed up.
55-
std::thread::sleep(Duration::from_secs(90));
58+
std::thread::sleep(Duration::from_secs(180));
5659

5760
// Run the command with tokio
5861
let temp_dir = tempfile::Builder::new()
@@ -67,7 +70,7 @@ async fn create_snapshot_works() {
6770
snap_file: &PathBuf,
6871
at: sp_core::H256,
6972
) -> tokio::process::Child {
70-
Command::new(cargo_bin("try-runtime"))
73+
Command::new(cargo_bin!("try-runtime"))
7174
.stdout(std::process::Stdio::piped())
7275
.stderr(std::process::Stdio::piped())
7376
.arg("--runtime=existing")
File renamed without changes.

core/tests/runtimes/people_rococo_runtime_different_spec_name.compact.compressed.wasm renamed to cli/tests/runtimes/people_rococo_runtime_different_spec_name.compact.compressed.wasm

File renamed without changes.

core/tests/runtimes/people_rococo_runtime_mbm_double_ok_300b.compact.compressed.wasm renamed to cli/tests/runtimes/people_rococo_runtime_mbm_double_ok_300b.compact.compressed.wasm

File renamed without changes.

core/tests/runtimes/people_rococo_runtime_mbm_duplicates_ok_80b.compact.compressed.wasm renamed to cli/tests/runtimes/people_rococo_runtime_mbm_duplicates_ok_80b.compact.compressed.wasm

File renamed without changes.

core/tests/runtimes/people_rococo_runtime_mbm_empty.compact.compressed.wasm renamed to cli/tests/runtimes/people_rococo_runtime_mbm_empty.compact.compressed.wasm

File renamed without changes.

core/tests/runtimes/people_rococo_runtime_mbm_fails.compact.compressed.wasm renamed to cli/tests/runtimes/people_rococo_runtime_mbm_fails.compact.compressed.wasm

File renamed without changes.

0 commit comments

Comments
 (0)