diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 5f18a45af9dc..fb88ca120f76 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -2255,6 +2255,10 @@ mod remote_tests { #[tokio::test] async fn run_migrations() { + if var("RUN_MIGRATION_TESTS").is_err() { + return + } + sp_tracing::try_init_simple(); let transport: Transport = var("WS").unwrap_or("wss://kusama-rpc.polkadot.io:443".to_string()).into(); @@ -2275,7 +2279,7 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::All)); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } #[tokio::test] diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index e7f1a8959522..9c1eb9ce6836 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -2451,6 +2451,10 @@ mod remote_tests { #[tokio::test] async fn run_migrations() { + if var("RUN_MIGRATION_TESTS").is_err() { + return + } + sp_tracing::try_init_simple(); let transport: Transport = var("WS").unwrap_or("wss://rpc.polkadot.io:443".to_string()).into(); @@ -2471,7 +2475,7 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::All)); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } #[tokio::test] diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index cd5f71079f1c..c2a353a48ef0 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -2099,7 +2099,7 @@ sp_api::impl_runtime_apis! { #[cfg(all(test, feature = "try-runtime"))] mod remote_tests { use super::*; - use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime; + use frame_try_runtime::{runtime_decl_for_TryRuntime::TryRuntime, UpgradeCheckSelect}; use remote_externalities::{ Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport, }; @@ -2107,6 +2107,10 @@ mod remote_tests { #[tokio::test] async fn run_migrations() { + if var("RUN_MIGRATION_TESTS").is_err() { + return + } + sp_tracing::try_init_simple(); let transport: Transport = var("WS").unwrap_or("wss://rococo-rpc.polkadot.io:443".to_string()).into(); @@ -2127,8 +2131,6 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| { - Runtime::on_runtime_upgrade(frame_try_runtime::UpgradeCheckSelect::All) - }); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 3cfd0167b50b..b11b3ced3376 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1853,7 +1853,7 @@ sp_api::impl_runtime_apis! { #[cfg(all(test, feature = "try-runtime"))] mod remote_tests { use super::*; - use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime; + use frame_try_runtime::{runtime_decl_for_TryRuntime::TryRuntime, UpgradeCheckSelect}; use remote_externalities::{ Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport, }; @@ -1861,6 +1861,10 @@ mod remote_tests { #[tokio::test] async fn run_migrations() { + if var("RUN_MIGRATION_TESTS").is_err() { + return + } + sp_tracing::try_init_simple(); let transport: Transport = var("WS").unwrap_or("wss://westend-rpc.polkadot.io:443".to_string()).into(); @@ -1881,9 +1885,7 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| { - Runtime::on_runtime_upgrade(frame_try_runtime::UpgradeCheckSelect::All) - }); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } } diff --git a/scripts/ci/gitlab/pipeline/test.yml b/scripts/ci/gitlab/pipeline/test.yml index 472790e970d8..ac77698f43cc 100644 --- a/scripts/ci/gitlab/pipeline/test.yml +++ b/scripts/ci/gitlab/pipeline/test.yml @@ -42,7 +42,7 @@ test-linux-stable: # but still want to have debug assertions. RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" script: - - time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics + - time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics,try-runtime .check-dependent-project: &check-dependent-project stage: test diff --git a/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs index 2bd73a85088b..e8acf8aa7bdc 100644 --- a/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs @@ -100,8 +100,6 @@ benchmarks! { call: double_encoded_noop_call, }; let xcm = Xcm(vec![instruction]); - - let num_events = frame_system::Pallet::::events().len(); }: { executor.bench_process(xcm)?; } verify {