Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

try-runtime-cli: execute-block & create-snapshot tests #14343

Merged
merged 24 commits into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4bb74f2
execute-block test
Szegoo Jun 11, 2023
cb9720c
test create-snapshot
Szegoo Jun 12, 2023
2644c25
oops
Szegoo Jun 12, 2023
64ed955
Update utils/frame/try-runtime/cli/tests/create_snapshot.rs
Szegoo Jun 15, 2023
aa7e6a7
Update utils/frame/try-runtime/cli/tests/create_snapshot.rs
Szegoo Jun 15, 2023
2989dfc
Update utils/frame/try-runtime/cli/tests/create_snapshot.rs
Szegoo Jun 15, 2023
af1cfde
remove snapshot
Szegoo Jun 15, 2023
c1d5b80
execute block: new log
Szegoo Jun 15, 2023
c3a964d
use prefix & make tempfile a dev dependencie
Szegoo Jun 15, 2023
e7a54ab
Update utils/frame/try-runtime/cli/tests/execute_block.rs
Szegoo Jun 16, 2023
d3a9ca9
Update utils/frame/try-runtime/cli/tests/create_snapshot.rs
Szegoo Jun 16, 2023
6ce396e
".git/.scripts/commands/fmt/fmt.sh"
Jun 16, 2023
7d274e6
Merge remote-tracking branch 'origin/master' into try-runtime-tests
Jun 17, 2023
f439f28
--at option in execute-block test
Szegoo Jun 17, 2023
84a27de
fixes & use --at option in create-snapshot test
Szegoo Jun 17, 2023
7581859
hmm
Szegoo Jun 17, 2023
8fc182a
fmt
Szegoo Jun 17, 2023
b7c157b
remove nonsense
Szegoo Jun 18, 2023
f1c77b4
Update utils/frame/try-runtime/cli/tests/create_snapshot.rs
Szegoo Jun 21, 2023
08b881c
Update utils/frame/try-runtime/cli/tests/execute_block.rs
Szegoo Jun 21, 2023
e78e7e4
remove unnecessary test modules
Szegoo Jun 21, 2023
4e3e29b
try to load snapshot file
Szegoo Jun 21, 2023
2c689d5
Merge branch 'paritytech:master' into try-runtime-tests
Szegoo Jun 21, 2023
daab1cc
fix
Szegoo Jun 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use prefix & make tempfile a dev dependencie
  • Loading branch information
Szegoo committed Jun 15, 2023
commit c3a964da89166fe303d2495e67a40eb31e6bcecf
2 changes: 1 addition & 1 deletion utils/frame/try-runtime/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ log = "0.4.17"
parity-scale-codec = "3.2.2"
serde = "1.0.163"
serde_json = "1.0.85"
tempfile = "3.1.0"
zstd = { version = "0.12.3", default-features = false }

[dev-dependencies]
assert_cmd = "2.0.10"
regex = "1.7.3"
substrate-cli-test-utils = { path = "../../../../test-utils/cli" }
tempfile = "3.1.0"
tokio = "1.27.0"

[features]
Expand Down
6 changes: 4 additions & 2 deletions utils/frame/try-runtime/cli/tests/create_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ mod tests {
time::Duration,
};
use substrate_cli_test_utils as common;
use tempfile::tempdir;
use tokio::process::{Child, Command};

#[tokio::test]
async fn create_snapshot_works() {
// Build substrate so binaries used in the test use the latest code.
common::build_substrate(&["--features=try-runtime"]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now understood why we have to build again. Just very annoying and slow…
Maybe we can somehow inherit the build args in this function, so that it re-uses the cargo cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great. It does take quite some time to run all of these tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that would be a follow up as well; debug that build_substrate function and check if we can make it re-use the already existing build artifacts by using the same compile args that were used for the test.


let temp_dir = tempdir().expect("Failed to create a tempdir");
let temp_dir = tempfile::Builder::new()
.prefix("try-runtime-cli-test-dir")
.tempdir()
.expect("Failed to create a tempdir");
let snap_file_path = temp_dir.path().join("snapshot.snap");

common::run_with_timeout(Duration::from_secs(60), async move {
Expand Down