diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 0d23a476a4e4..916a5c023922 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -2231,7 +2231,7 @@ mod multiplier_tests { #[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, }; @@ -2239,6 +2239,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(); @@ -2259,6 +2263,6 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| Runtime::on_runtime_upgrade(true)); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 44a1b31d6b5d..78947ba6c2e9 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -2427,7 +2427,7 @@ mod multiplier_tests { #[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, }; @@ -2435,6 +2435,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(); @@ -2455,6 +2459,6 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| Runtime::on_runtime_upgrade(true)); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 1855b82b98ae..b416214bf68f 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,6 +2131,6 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| Runtime::on_runtime_upgrade(true)); + ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost)); } } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index aa5e2c0d029e..2704922a2799 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1850,7 +1850,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, }; @@ -1858,6 +1858,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(); @@ -1878,7 +1882,7 @@ mod remote_tests { .build() .await .unwrap(); - ext.execute_with(|| Runtime::on_runtime_upgrade(true)); + 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