diff --git a/Cargo.lock b/Cargo.lock index c17707e6f..e3d5f007c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2035,13 +2035,11 @@ dependencies = [ [[package]] name = "cucumber" -version = "0.18.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2b97b1b5763e57aeddbfc796f726daa8e561922e6438daffc5087b7bd03834" +checksum = "2940c675f8b0dd864bfedb4283d5fa07b8799eed59a4f7b09fb1257b18c88a1e" dependencies = [ "anyhow", - "async-trait", - "atty", "clap 4.5.4", "console", "cucumber-codegen", @@ -2054,44 +2052,47 @@ dependencies = [ "globwalk", "humantime 2.1.0", "inventory", - "itertools 0.10.5", + "itertools 0.12.1", "junit-report", + "lazy-regex", "linked-hash-map", "once_cell", + "pin-project 1.1.5", "regex", - "sealed 0.4.0", + "sealed", "serde", "serde_json", + "smart-default", ] [[package]] name = "cucumber-codegen" -version = "0.18.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755eae3e762505d670bbf02db048d512e79118f93f8383ae1bf6235506ed3c94" +checksum = "a5c9c7e0af8103f81ab300a21be3df1d57a003a151cf0bf41fdd343f85d14552" dependencies = [ "cucumber-expressions", "inflections", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", "regex", - "syn 1.0.109", + "syn 2.0.59", "synthez", ] [[package]] name = "cucumber-expressions" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40d2fdf5e1bb4ae7e6b25c97bf9b9d249a02243fc0fbd91075592b5f00a3bc1" +checksum = "d794fed319eea24246fb5f57632f7ae38d61195817b7eb659455aa5bdd7c1810" dependencies = [ "derive_more", "either", "nom", "nom_locate", "regex", - "regex-syntax 0.6.29", + "regex-syntax 0.7.5", ] [[package]] @@ -3245,16 +3246,16 @@ dependencies = [ [[package]] name = "gherkin" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8f8f49b2b547ec22cc4d99f3bf30d4889ef0dbaa231c0736eeaf20efb5a38e" +checksum = "20b79820c0df536d1f3a089a2fa958f61cb96ce9e0f3f8f507f5a31179567755" dependencies = [ "heck 0.4.1", "peg", "quote", "serde", "serde_json", - "syn 1.0.109", + "syn 2.0.59", "textwrap 0.16.1", "thiserror", "typed-builder", @@ -3298,11 +3299,11 @@ dependencies = [ [[package]] name = "globwalk" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "ignore", "walkdir", ] @@ -4299,6 +4300,29 @@ dependencies = [ "regex-automata 0.4.6", ] +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.59", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -5568,7 +5592,7 @@ dependencies = [ "fixed-hash", "hex", "hex-literal 0.4.1", - "sealed 0.5.0", + "sealed", "serde", "thiserror", "tiny-keccak", @@ -7302,6 +7326,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.3" @@ -7855,30 +7885,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "sealed" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "636b9882a0f4cc2039488df89a10eb4b7976d4b6c1917fc0518f3f0f5e2c72ca" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "sealed" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5e421024b5e5edfbaa8e60ecf90bda9dbffc602dbb230e6028763f85f0c68c" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sealed" version = "0.5.0" @@ -8280,6 +8286,17 @@ version = "2.0.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24bd433ebbd599a277e9e73bf6220f3193842551fab233949b7254306dccdac1" +[[package]] +name = "smart-default" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.59", +] + [[package]] name = "smawk" version = "0.3.2" @@ -8614,35 +8631,35 @@ dependencies = [ [[package]] name = "synthez" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033178d0acccffc5490021657006e6a8dd586ee9dc6f7c24e7608b125e568cb1" +checksum = "a3d2c2202510a1e186e63e596d9318c91a8cbe85cd1a56a7be0c333e5f59ec8d" dependencies = [ - "syn 1.0.109", + "syn 2.0.59", "synthez-codegen", "synthez-core", ] [[package]] name = "synthez-codegen" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69263462a40e46960f070618e20094ce69e783a41f86e54bc75545136afd597a" +checksum = "f724aa6d44b7162f3158a57bccd871a77b39a4aef737e01bcdff41f4772c7746" dependencies = [ - "syn 1.0.109", + "syn 2.0.59", "synthez-core", ] [[package]] name = "synthez-core" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8b5a4089fe1723279f06302afda64a5dacaa11a82bcbb4d08759590d4389d9" +checksum = "78bfa6ec52465e2425fd43ce5bbbe0f0b623964f7c63feb6b10980e816c654ea" dependencies = [ "proc-macro2", "quote", - "sealed 0.3.0", - "syn 1.0.109", + "sealed", + "syn 2.0.59", ] [[package]] @@ -10955,13 +10972,22 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.10.0" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe83c85a85875e8c4cb9ce4a890f05b23d38cd0d47647db7895d3d2a79566d2" +dependencies = [ + "typed-builder-macro", +] + +[[package]] +name = "typed-builder-macro" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" +checksum = "29a3151c41d0b13e3d011f98adc24434560ef06673a155a6c7f66b9879eecce2" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.59", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b7f2b773a..79df9d825 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -159,7 +159,7 @@ chacha20poly1305 = "0.10.1" chrono = "0.4.24" config = "0.14.0" convert_case = "0.6.0" -cucumber = "0.18.0" +cucumber = "0.21.0" d3ne = { git = "https://github.com/stringhandler/d3ne-rs.git", tag = "v0.8.0-pre.3" } dashmap = "5.5.0" diesel = { version = "2", default-features = false } diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 3c351f909..007d575c6 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -48,33 +48,18 @@ anyhow = { workspace = true } # if we set this version in the workspace it would break other crates base64 = "0.21.0" config = { workspace = true } -cucumber = { workspace = true, features = [ - "default", - "libtest", - "output-junit", -] } +cucumber = { workspace = true, features = ["default", "libtest", "output-junit"] } httpmock = { workspace = true } indexmap = { workspace = true } libp2p = { workspace = true } log = { workspace = true, features = ["std"] } -log4rs = { workspace = true, features = [ - "rolling_file_appender", - "compound_policy", - "size_trigger", - "fixed_window_roller", -] } +log4rs = { workspace = true, features = ["rolling_file_appender", "compound_policy", "size_trigger", "fixed_window_roller"] } rand = { workspace = true } reqwest = { workspace = true } serde = { workspace = true, features = ["default", "derive"] } serde_json = { workspace = true } time = { workspace = true } -tokio = { workspace = true, features = [ - "default", - "macros", - "time", - "sync", - "rt-multi-thread", -] } +tokio = { workspace = true, features = ["default", "macros", "time", "sync", "rt-multi-thread", "signal"] } tonic = { workspace = true } [[test]] diff --git a/integration_tests/tests/cucumber.rs b/integration_tests/tests/cucumber.rs index deb0f386e..f278b96d1 100644 --- a/integration_tests/tests/cucumber.rs +++ b/integration_tests/tests/cucumber.rs @@ -34,7 +34,13 @@ use integration_tests::{ wallet_daemon_cli, TariWorld, }; -use libp2p::Multiaddr; +use libp2p::{ + futures::{ + future::{select, Either}, + pin_mut, + }, + Multiaddr, +}; use tari_common::initialize_logging; use tari_dan_engine::abi::Type; use tari_dan_storage::consensus_models::QuorumDecision; @@ -54,7 +60,7 @@ async fn main() { let mock_port = spawn_template_http_server(shutdown.to_signal()).await; let file = fs::File::create("cucumber-output-junit.xml").unwrap(); - TariWorld::cucumber() + let cucumber_fut = TariWorld::cucumber() .max_concurrent_scenarios(1) .with_writer(writer::Tee::new( writer::JUnit::new(file, Verbosity::ShowWorldAndDocString).normalized(), @@ -84,8 +90,15 @@ async fn main() { Box::pin(future::ready(())) }) .fail_on_skipped() - .filter_run("tests/features/", |_, _, sc| !sc.tags.iter().any(|t| t == "ignore")) - .await; + .filter_run("tests/features/", |_, _, sc| !sc.tags.iter().any(|t| t == "ignore")); + + let ctrl_c = tokio::signal::ctrl_c(); + pin_mut!(ctrl_c); + pin_mut!(cucumber_fut); + match select(cucumber_fut, ctrl_c).await { + Either::Left(_) => {}, + Either::Right((ctrl_c, _)) => ctrl_c.unwrap(), + } shutdown.trigger(); }