-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
integration: | ||
cargo test --test cucumber -- | ||
cargo test --test features_runner -- | ||
|
||
docker-test: | ||
./tests/docker/run_docker.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use cucumber::WorldInit; | ||
use step_defs::integration; | ||
|
||
mod step_defs; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
integration::algod::World::run(integration_path("algod")).await; | ||
integration::abi::World::run(integration_path("abi")).await; | ||
} | ||
|
||
fn integration_path(feature_name: &str) -> String { | ||
format!("tests/features/integration/{}.feature", feature_name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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<Algod>, | ||
} | ||
|
||
#[async_trait(?Send)] | ||
impl cucumber::World for World { | ||
type Error = Infallible; | ||
|
||
async fn new() -> Result<Self, Self::Error> { | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod abi; | ||
pub mod algod; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod integration; |