Skip to content

Commit 5ad3cc0

Browse files
authored
Merge pull request #141 from movementlabsxyz/sebtomba/move-e2e-criteria
Reapply refactor(e2e): move e2e criterion GlobalFeatureCheck to checks/migrator
2 parents 66e7e00 + dc4fe8b commit 5ad3cc0

File tree

29 files changed

+679
-68
lines changed

29 files changed

+679
-68
lines changed

Cargo.lock

Lines changed: 69 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ mtma-node-test-global-storage-not-empty-criterion = { path = "checks/node/citeri
192192

193193
### migrator
194194
mtma-migrator-test-types = { path = "checks/migrator/util/types" }
195+
mtma-migrator-test-empty-criterion = { path = "checks/migrator/citeria/empty" }
196+
mtma-migrator-test-matching-feature-flags-criterion = { path = "checks/migrator/citeria/matching-feature-flags" }
197+
mtma-migrator-test-transacting-criterion = { path = "checks/migrator/citeria/transacting" }
195198
mtma-migrator-test-accounts-equal-criterion = { path = "checks/migrator/citeria/accounts-equal" }
196199
mtma-migrator-test-balances-equal-criterion = { path = "checks/migrator/citeria/balances-equal" }
197200

checks/migrator/checks/balances-equal/Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,12 @@ publish = { workspace = true }
99
rust-version = { workspace = true }
1010

1111
[dependencies]
12-
mtma-types = { workspace = true }
1312
mtma-migrator-types = { workspace = true }
1413
mtma-migrator-test-types = { workspace = true }
1514
anyhow = { workspace = true }
16-
mtma-node-replay-core = { workspace = true }
17-
mtma-node-test-global-storage-injective-criterion = { workspace = true }
18-
mtma-node-test-global-storage-includes-criterion = { workspace = true }
19-
mtma-node-test-global-storage-not-empty-criterion = { workspace = true }
2015
mtma-migrator-test-balances-equal-criterion = { workspace = true }
21-
mtma-node-preludes = { workspace = true }
2216
mtma-node-null-core = { workspace = true }
2317
tokio = { workspace = true }
24-
chrono = { workspace = true }
25-
rand = { workspace = true }
2618
kestrel = { workspace = true }
2719
mtma-node-test-types = { workspace = true }
2820

checks/migrator/checks/balances-equal/src/balances_equal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ pub mod test {
6868
// exit the test is fine when you only have one test per crate because when cargo test is run across a workspace, it actually multi-processes the tests by crate
6969
std::process::exit(0);
7070

71-
Ok(())
71+
// Ok(())
7272
}
7373
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[package]
2+
name = "mtma-migrator-matching-feature-flags"
3+
version = { workspace = true }
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
authors = { workspace = true }
7+
homepage = { workspace = true }
8+
publish = { workspace = true }
9+
rust-version = { workspace = true }
10+
11+
[dependencies]
12+
mtma-migrator-types = { workspace = true }
13+
mtma-migrator-test-types = { workspace = true }
14+
anyhow = { workspace = true }
15+
mtma-migrator-test-matching-feature-flags-criterion = { workspace = true }
16+
mtma-node-null-core = { workspace = true }
17+
tokio = { workspace = true }
18+
kestrel = { workspace = true }
19+
mtma-node-test-types = { workspace = true }
20+
21+
[dev-dependencies]
22+
tracing-test = { workspace = true }
23+
tracing = { workspace = true }
24+
25+
[lints]
26+
workspace = true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Migration Executor Checks Sketchpad
2+
A sketchpad for playing around with checks on the testpad.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod matching_feature_flags;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#[cfg(test)]
2+
pub mod test {
3+
use mtma_migrator_test_matching_feature_flags_criterion::GlobalFeatureCheck;
4+
use mtma_migrator_test_types::check::checked_migration;
5+
use mtma_migrator_types::migrator::{movement_migrator::Overlays, MovementMigrator};
6+
use mtma_node_null_core::config::Config as MtmaNullConfig;
7+
use mtma_node_test_types::prelude::Prelude;
8+
9+
#[tokio::test]
10+
#[tracing_test::traced_test]
11+
#[ignore = "activate when runtime problems are solved"]
12+
async fn test_matching_feature_flags() -> Result<(), anyhow::Error> {
13+
// Form the migrator.
14+
let mut movement_migrator = MovementMigrator::try_temp()?;
15+
// TODO: use `MovementMigrator::try_debug_home()`
16+
// let mut movement_migrator = MovementMigrator::try_debug_home()?;
17+
movement_migrator.set_overlays(Overlays::default());
18+
19+
// Start the migrator so that it's running in the background.
20+
// In the future, some migrators may be for already running nodes.
21+
let movement_migrator_for_task = movement_migrator.clone();
22+
let movement_migrator_task = kestrel::task(async move {
23+
movement_migrator_for_task.run().await?;
24+
Ok::<_, anyhow::Error>(())
25+
});
26+
27+
tokio::time::sleep(tokio::time::Duration::from_secs(30)).await;
28+
29+
kestrel::end!(movement_migrator_task)?;
30+
31+
// Form the prelude.
32+
// todo: this needs to be updated to use the prelude generator
33+
let prelude = Prelude::new_empty();
34+
35+
// Form the migration.
36+
let migration_config = MtmaNullConfig::default();
37+
let migration = migration_config.build()?;
38+
39+
// Run the checked migration.
40+
let matching_feature_flags = GlobalFeatureCheck::new();
41+
checked_migration(
42+
&mut movement_migrator,
43+
&prelude,
44+
&migration,
45+
vec![matching_feature_flags],
46+
)
47+
.await?;
48+
49+
Ok(())
50+
}
51+
}

checks/migrator/checks/sketchpad/Cargo.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,19 @@ publish = { workspace = true }
99
rust-version = { workspace = true }
1010

1111
[dependencies]
12-
mtma-types = { workspace = true }
1312
mtma-migrator-types = { workspace = true }
1413
mtma-migrator-test-types = { workspace = true }
1514
anyhow = { workspace = true }
16-
mtma-node-replay-core = { workspace = true }
17-
mtma-node-test-global-storage-injective-criterion = { workspace = true }
18-
mtma-node-test-global-storage-includes-criterion = { workspace = true }
19-
mtma-node-test-global-storage-not-empty-criterion = { workspace = true }
2015
mtma-migrator-test-accounts-equal-criterion = { workspace = true }
21-
mtma-node-preludes = { workspace = true }
2216
mtma-node-null-core = { workspace = true }
2317
tokio = { workspace = true }
24-
chrono = { workspace = true }
25-
rand = { workspace = true }
2618
kestrel = { workspace = true }
2719
mtma-node-test-types = { workspace = true }
2820
mtma-migrator-pre-l1-merge-core = { workspace = true }
2921

3022
[dev-dependencies]
3123
tracing-test = { workspace = true }
3224
tracing = { workspace = true }
33-
tempfile = { workspace = true }
3425

3526
[lints]
3627
workspace = true

checks/migrator/checks/sketchpad/src/accounts_equal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ pub mod test {
6868
// exit the test is fine when you only have one test per crate because when cargo test is run across a workspace, it actually multi-processes the tests by crate
6969
std::process::exit(0);
7070

71-
Ok(())
71+
// Ok(())
7272
}
7373
}

0 commit comments

Comments
 (0)