mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
Enable try-runtime flag in CI (#6587)
* Env gate tests The CI should check that it compiles, but not run it. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Enable try-runtime feature in CI Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
b59d0b832d
commit
ac67b0aa67
@@ -2231,7 +2231,7 @@ mod multiplier_tests {
|
|||||||
#[cfg(all(test, feature = "try-runtime"))]
|
#[cfg(all(test, feature = "try-runtime"))]
|
||||||
mod remote_tests {
|
mod remote_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime;
|
use frame_try_runtime::{runtime_decl_for_TryRuntime::TryRuntime, UpgradeCheckSelect};
|
||||||
use remote_externalities::{
|
use remote_externalities::{
|
||||||
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
||||||
};
|
};
|
||||||
@@ -2239,6 +2239,10 @@ mod remote_tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn run_migrations() {
|
async fn run_migrations() {
|
||||||
|
if var("RUN_MIGRATION_TESTS").is_err() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sp_tracing::try_init_simple();
|
sp_tracing::try_init_simple();
|
||||||
let transport: Transport =
|
let transport: Transport =
|
||||||
var("WS").unwrap_or("wss://kusama-rpc.polkadot.io:443".to_string()).into();
|
var("WS").unwrap_or("wss://kusama-rpc.polkadot.io:443".to_string()).into();
|
||||||
@@ -2259,6 +2263,6 @@ mod remote_tests {
|
|||||||
.build()
|
.build()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ext.execute_with(|| Runtime::on_runtime_upgrade(true));
|
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2427,7 +2427,7 @@ mod multiplier_tests {
|
|||||||
#[cfg(all(test, feature = "try-runtime"))]
|
#[cfg(all(test, feature = "try-runtime"))]
|
||||||
mod remote_tests {
|
mod remote_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime;
|
use frame_try_runtime::{runtime_decl_for_TryRuntime::TryRuntime, UpgradeCheckSelect};
|
||||||
use remote_externalities::{
|
use remote_externalities::{
|
||||||
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
||||||
};
|
};
|
||||||
@@ -2435,6 +2435,10 @@ mod remote_tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn run_migrations() {
|
async fn run_migrations() {
|
||||||
|
if var("RUN_MIGRATION_TESTS").is_err() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sp_tracing::try_init_simple();
|
sp_tracing::try_init_simple();
|
||||||
let transport: Transport =
|
let transport: Transport =
|
||||||
var("WS").unwrap_or("wss://rpc.polkadot.io:443".to_string()).into();
|
var("WS").unwrap_or("wss://rpc.polkadot.io:443".to_string()).into();
|
||||||
@@ -2455,6 +2459,6 @@ mod remote_tests {
|
|||||||
.build()
|
.build()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ext.execute_with(|| Runtime::on_runtime_upgrade(true));
|
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2099,7 +2099,7 @@ sp_api::impl_runtime_apis! {
|
|||||||
#[cfg(all(test, feature = "try-runtime"))]
|
#[cfg(all(test, feature = "try-runtime"))]
|
||||||
mod remote_tests {
|
mod remote_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime;
|
use frame_try_runtime::{runtime_decl_for_TryRuntime::TryRuntime, UpgradeCheckSelect};
|
||||||
use remote_externalities::{
|
use remote_externalities::{
|
||||||
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
||||||
};
|
};
|
||||||
@@ -2107,6 +2107,10 @@ mod remote_tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn run_migrations() {
|
async fn run_migrations() {
|
||||||
|
if var("RUN_MIGRATION_TESTS").is_err() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sp_tracing::try_init_simple();
|
sp_tracing::try_init_simple();
|
||||||
let transport: Transport =
|
let transport: Transport =
|
||||||
var("WS").unwrap_or("wss://rococo-rpc.polkadot.io:443".to_string()).into();
|
var("WS").unwrap_or("wss://rococo-rpc.polkadot.io:443".to_string()).into();
|
||||||
@@ -2127,6 +2131,6 @@ mod remote_tests {
|
|||||||
.build()
|
.build()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ext.execute_with(|| Runtime::on_runtime_upgrade(true));
|
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1850,7 +1850,7 @@ sp_api::impl_runtime_apis! {
|
|||||||
#[cfg(all(test, feature = "try-runtime"))]
|
#[cfg(all(test, feature = "try-runtime"))]
|
||||||
mod remote_tests {
|
mod remote_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime;
|
use frame_try_runtime::{runtime_decl_for_TryRuntime::TryRuntime, UpgradeCheckSelect};
|
||||||
use remote_externalities::{
|
use remote_externalities::{
|
||||||
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport,
|
||||||
};
|
};
|
||||||
@@ -1858,6 +1858,10 @@ mod remote_tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn run_migrations() {
|
async fn run_migrations() {
|
||||||
|
if var("RUN_MIGRATION_TESTS").is_err() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sp_tracing::try_init_simple();
|
sp_tracing::try_init_simple();
|
||||||
let transport: Transport =
|
let transport: Transport =
|
||||||
var("WS").unwrap_or("wss://westend-rpc.polkadot.io:443".to_string()).into();
|
var("WS").unwrap_or("wss://westend-rpc.polkadot.io:443".to_string()).into();
|
||||||
@@ -1878,7 +1882,7 @@ mod remote_tests {
|
|||||||
.build()
|
.build()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ext.execute_with(|| Runtime::on_runtime_upgrade(true));
|
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ test-linux-stable:
|
|||||||
# but still want to have debug assertions.
|
# but still want to have debug assertions.
|
||||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||||
script:
|
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
|
.check-dependent-project: &check-dependent-project
|
||||||
stage: test
|
stage: test
|
||||||
|
|||||||
Reference in New Issue
Block a user