diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d4c1f4a25..6653a00071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,13 +29,14 @@ ### BUG FIXES - [ibc] - - [nothing yet] + - Fix panic in conn open try when no connection id is provided ([#626]) + - Disable MBT tests if the "mocks" feature is not enabled ([#643]) - [ibc-relayer] - [nothing yet] - [ibc-relayer-cli] - - [nothing yet] + - Fix wrong acks sent with `tx raw packet-ack` in a 3-chain setup ([#614]) ### BREAKING CHANGES @@ -49,23 +50,12 @@ - [ibc-relayer-cli] - [nothing yet] -### BUG FIXES - -- [ibc] - - Fix panic in conn open try when no connection id is provided ([#626]) - -- [ibc-relayer] - - [nothing yet] - -- [ibc-relayer-cli] - - Fix wrong acks sent with `tx raw packet-ack` in a 3-chain setup ([#614]) - - [#316]: https://github.com/informalsystems/ibc-rs/issues/316 [#560]: https://github.com/informalsystems/ibc-rs/issues/560 [#614]: https://github.com/informalsystems/ibc-rs/issues/614 [#624]: https://github.com/informalsystems/ibc-rs/issues/624 [#626]: https://github.com/informalsystems/ibc-rs/issues/626 +[#643]: https://github.com/informalsystems/ibc-rs/issues/643 ## v0.1.0 *February 4, 2021* diff --git a/modules/Cargo.toml b/modules/Cargo.toml index e30594b7d4..1019f4a135 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -53,3 +53,8 @@ optional = true tokio = { version = "1.0", features = ["macros"] } tendermint-rpc = { version = "=0.18.0", features = ["http-client", "websocket-client"] } tendermint-testgen = { version = "=0.18.0" } # Needed for generating (synthetic) light blocks. + +[[test]] +name = "mbt" +path = "tests/mbt.rs" +required-features = ["mocks"] diff --git a/modules/tests/README.md b/modules/tests/README.md index 54e6491585..670f5b521e 100644 --- a/modules/tests/README.md +++ b/modules/tests/README.md @@ -59,5 +59,5 @@ These are currently generated manually, but can be easily mapped to Rust (see [s The model-based tests can be run with the following command: ```bash -cargo test -p ibc --features mocks -- model_based +cargo test --features mocks -- mbt ``` diff --git a/modules/tests/model_based.rs b/modules/tests/executor/mod.rs similarity index 93% rename from modules/tests/model_based.rs rename to modules/tests/executor/mod.rs index 5f11385afd..7dafed984c 100644 --- a/modules/tests/model_based.rs +++ b/modules/tests/executor/mod.rs @@ -1,5 +1,5 @@ -mod modelator; -mod step; +pub mod modelator; +pub mod step; use ibc::ics02_client::client_def::{AnyClientState, AnyConsensusState, AnyHeader}; use ibc::ics02_client::client_type::ClientType; @@ -24,13 +24,13 @@ use step::{ActionOutcome, ActionType, Chain, Step}; use tendermint::account::Id as AccountId; #[derive(Debug)] -struct IBCTestExecutor { +pub struct IBCTestExecutor { // mapping from chain identifier to its context contexts: HashMap, } impl IBCTestExecutor { - fn new() -> Self { + pub fn new() -> Self { Self { contexts: Default::default(), } @@ -250,20 +250,3 @@ impl modelator::TestExecutor for IBCTestExecutor { outcome_matches && self.check_chain_heights(step.chains) } } - -const TESTS_DIR: &str = "tests/support/model_based/tests"; - -#[test] -fn model_based() { - let tests = vec!["ICS02UpdateOKTest", "ICS02HeaderVerificationFailureTest"]; - - for test in tests { - let test = format!("{}/{}.json", TESTS_DIR, test); - let executor = IBCTestExecutor::new(); - // we should be able to just return the `Result` once the following issue - // is fixed: https://github.com/rust-lang/rust/issues/43301 - if let Err(e) = modelator::test(&test, executor) { - panic!("{:?}", e); - } - } -} diff --git a/modules/tests/modelator.rs b/modules/tests/executor/modelator.rs similarity index 100% rename from modules/tests/modelator.rs rename to modules/tests/executor/modelator.rs diff --git a/modules/tests/step.rs b/modules/tests/executor/step.rs similarity index 100% rename from modules/tests/step.rs rename to modules/tests/executor/step.rs diff --git a/modules/tests/mbt.rs b/modules/tests/mbt.rs new file mode 100644 index 0000000000..4ac8059990 --- /dev/null +++ b/modules/tests/mbt.rs @@ -0,0 +1,18 @@ +mod executor; + +const TESTS_DIR: &str = "tests/support/model_based/tests"; + +#[test] +fn mbt() { + let tests = vec!["ICS02UpdateOKTest", "ICS02HeaderVerificationFailureTest"]; + + for test in tests { + let test = format!("{}/{}.json", TESTS_DIR, test); + let executor = executor::IBCTestExecutor::new(); + // we should be able to just return the `Result` once the following issue + // is fixed: https://github.com/rust-lang/rust/issues/43301 + if let Err(e) = executor::modelator::test(&test, executor) { + panic!("{:?}", e); + } + } +}