diff --git a/tests/features_runner.rs b/tests/features_runner.rs index 86853b90..3d50c664 100644 --- a/tests/features_runner.rs +++ b/tests/features_runner.rs @@ -5,16 +5,24 @@ mod step_defs; #[tokio::main] async fn main() { - // algod feature: omitted, this tests v1 and we don't support it anymore - // integration::algod::World::run(integration_path("algod")).await; + // NOTE: we don't support algod v1 anymore + // features which depend completely on algod v1 are omitted - // ABI not supported yet - // integration::abi::World::run(integration_path("abi")).await; + // algod feature: omitted (algod v1) + + // TODO abi feature: ABI not supported yet integration::applications::World::cucumber() .max_concurrent_scenarios(1) .run(integration_path("applications")) .await; + + integration::applications::World::cucumber() + .max_concurrent_scenarios(1) + .run(integration_path("applications")) + .await; + + // assets feature: omitted (algod v1) } fn integration_path(feature_name: &str) -> String { diff --git a/tests/step_defs/integration/abi.rs b/tests/step_defs/integration/abi.rs deleted file mode 100644 index 75c07c23..00000000 --- a/tests/step_defs/integration/abi.rs +++ /dev/null @@ -1,29 +0,0 @@ -use algonaut::algod::v2::Algod; -use algonaut::algod::AlgodBuilder; -use async_trait::async_trait; -use cucumber::{given, WorldInit}; -use std::convert::Infallible; - -#[derive(Default, Debug, WorldInit)] -pub struct World { - algod: Option, -} - -#[async_trait(?Send)] -impl cucumber::World for World { - type Error = Infallible; - - async fn new() -> Result { - Ok(Self::default()) - } -} - -#[given(expr = "an algod v2 client")] -async fn an_algod_v2_client(w: &mut World) { - let algod = AlgodBuilder::new() - .bind("http://localhost:60000") - .auth("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - .build_v2() - .unwrap(); - w.algod = Some(algod) -} diff --git a/tests/step_defs/integration/algod.rs b/tests/step_defs/integration/algod.rs deleted file mode 100644 index 8b77ff66..00000000 --- a/tests/step_defs/integration/algod.rs +++ /dev/null @@ -1,62 +0,0 @@ -use algonaut::algod::v2::Algod; -use algonaut::algod::AlgodBuilder; -use algonaut_core::Round; -use algonaut_model::algod::v2::NodeStatus; -use async_trait::async_trait; -use cucumber::{given, then, when, WorldInit}; -use std::convert::Infallible; - -#[derive(Default, Debug, WorldInit)] -pub struct World { - algod_client: Option, - node_status: Option, - last_round: Option, -} - -#[async_trait(?Send)] -impl cucumber::World for World { - type Error = Infallible; - - async fn new() -> Result { - Ok(Self::default()) - } -} - -#[given(expr = "an algod client")] -async fn an_algod_client(w: &mut World) { - let algod = AlgodBuilder::new() - .bind("http://localhost:60000") - .auth("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - .build_v2() - .unwrap(); - - w.algod_client = Some(algod) -} - -#[then(expr = "the node should be healthy")] -async fn node_is_healthy(w: &mut World) { - let algod_client = w.algod_client.as_ref().unwrap(); - algod_client.health().await.unwrap(); -} - -#[when(expr = "I get the status")] -async fn i_get_the_status(w: &mut World) { - let algod_client = w.algod_client.as_ref().unwrap(); - let status = algod_client.status().await.unwrap(); - w.last_round = Some(status.last_round); - w.node_status = Some(status); -} - -#[when(expr = "I get status after this block")] -async fn i_get_the_status_after_this_block(w: &mut World) { - let algod_client = w.algod_client.as_ref().unwrap(); - let block = w.last_round.unwrap(); - algod_client.status_after_round(Round(block)).await.unwrap(); -} - -#[then(expr = "I can get the block info")] -async fn i_can_get_the_block_info(w: &mut World) { - let algod_client = w.algod_client.as_ref().unwrap(); - let last_round = w.last_round.unwrap(); - algod_client.block(Round(last_round)).await.unwrap(); -} diff --git a/tests/step_defs/integration/applications.rs b/tests/step_defs/integration/applications.rs index 36bf75fd..92fc7ee6 100644 --- a/tests/step_defs/integration/applications.rs +++ b/tests/step_defs/integration/applications.rs @@ -49,7 +49,8 @@ impl cucumber::World for World { #[given(expr = "an algod client")] async fn an_algod_client(_: &mut World) { - // do nothing - we don't support v1 + // Do nothing - we don't support v1 + // The reference (Go) SDK doesn't use it in the definitions } #[given(expr = "a kmd client")] diff --git a/tests/step_defs/integration/mod.rs b/tests/step_defs/integration/mod.rs index 4dd12ffb..c0e90580 100644 --- a/tests/step_defs/integration/mod.rs +++ b/tests/step_defs/integration/mod.rs @@ -1,3 +1 @@ -pub mod abi; -pub mod algod; pub mod applications;