Run all tests with try-runtime feature enabled (#14396)

* Run all tests with `try-runtime` feature enabled

There are some tests that are guarded behind the `try-runtime` feature which are currently not being
executed. This pull requests changes this and enables the feature for the test run.

* Add some docs

* Rename variable
This commit is contained in:
Bastian Köcher
2023-06-16 12:16:19 +02:00
committed by GitHub
parent 4311411133
commit 53f4b4df76
7 changed files with 46 additions and 22 deletions
@@ -281,7 +281,7 @@ benchmarks! {
#[pov_mode = Measured]
migrate {
StorageVersion::new(0).put::<Pallet<T>>();
<Migration::<T> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade();
<Migration::<T, false> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade();
let origin: RawOrigin<<T as frame_system::Config>::AccountId> = RawOrigin::Signed(whitelisted_caller());
}: {
<Contracts<T>>::migrate(origin.into(), Weight::MAX).unwrap()
@@ -294,7 +294,7 @@ benchmarks! {
on_runtime_upgrade_noop {
assert_eq!(StorageVersion::get::<Pallet<T>>(), 2);
}: {
<Migration::<T> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade()
<Migration::<T, false> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade()
} verify {
assert!(MigrationInProgress::<T>::get().is_none());
}
@@ -306,7 +306,7 @@ benchmarks! {
let v = vec![42u8].try_into().ok();
MigrationInProgress::<T>::set(v.clone());
}: {
<Migration::<T> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade()
<Migration::<T, false> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade()
} verify {
assert!(MigrationInProgress::<T>::get().is_some());
assert_eq!(MigrationInProgress::<T>::get(), v);
@@ -317,7 +317,7 @@ benchmarks! {
on_runtime_upgrade {
StorageVersion::new(0).put::<Pallet<T>>();
}: {
<Migration::<T> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade()
<Migration::<T, false> as frame_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade()
} verify {
assert!(MigrationInProgress::<T>::get().is_some());
}