Skip to content

Commit

Permalink
Conditional execution of transfer tests based on framework-test feature
Browse files Browse the repository at this point in the history
  • Loading branch information
nieznanysprawiciel committed Dec 19, 2023
1 parent 95a04a2 commit c2b468e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dummy-driver = ['ya-dummy-driver']
erc20-driver = ['ya-erc20-driver']
erc20next-driver = ['ya-erc20next-driver']
tos = []
framework-test = []
framework-test = ['ya-exe-unit/framework-test']
# Temporary to make goth integration tests work
central-net = ['ya-net/central-net']
packet-trace-enable = [
Expand Down Expand Up @@ -65,6 +65,7 @@ ya-client-model = "0.5"

gftp = { version = "0.3.1", optional = true } # just to enable gftp build for cargo-deb
ya-provider = { version = "0.3", optional = true } # just to enable conditionally running some tests
ya-exe-unit = { version = "0.4", optional = true } # just to enable conditionally running some tests

actix-rt = "2.7"
actix-service = "2"
Expand All @@ -91,6 +92,7 @@ libsqlite3-sys = { workspace = true }

[dev-dependencies]
ya-test-framework = "0.1"
ya-exe-unit = { version = "0.4" }

[package.metadata.deb]
name = "golem-requestor"
Expand Down
1 change: 1 addition & 0 deletions exe-unit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sgx = [
'ya-transfer/sgx',
]
packet-trace-enable = ["ya-packet-trace/enable"]
framework-test = ["ya-transfer/framework-test"]

[target.'cfg(target_family = "unix")'.dependencies]
nix = "0.22.0"
Expand Down
4 changes: 2 additions & 2 deletions exe-unit/components/transfer/tests/test_transfer_abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ async fn interrupted_transfer(
Ok(())
}

// #[cfg_attr(not(feature = "framework-test"), ignore)]
#[cfg_attr(not(feature = "framework-test"), ignore)]
#[test_context(DroppableTestContext)]
#[serial_test::serial]
async fn test_transfer_abort(ctx: &mut DroppableTestContext) -> anyhow::Result<()> {
env::set_var(
"RUST_LOG",
env::var("RUST_LOG").unwrap_or_else(|_| "debug".into()),
);
env_logger::try_init().ok();
//env_logger::try_init().ok();

let temp_dir = temp_dir!("transfer-abort")?;
let temp_dir = temp_dir.path();
Expand Down
8 changes: 4 additions & 4 deletions exe-unit/components/transfer/tests/test_transfer_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ async fn transfer_with_args(
Ok(())
}

// #[cfg_attr(not(feature = "framework-test"), ignore)]
#[cfg_attr(not(feature = "framework-test"), ignore)]
#[test_context(DroppableTestContext)]
#[serial_test::serial]
async fn test_transfer_scenarios(ctx: &mut DroppableTestContext) -> anyhow::Result<()> {
env::set_var(
"RUST_LOG",
env::var("RUST_LOG").unwrap_or_else(|_| "debug".into()),
);
env_logger::try_init().ok();
//env_logger::try_init().ok();

let dir = temp_dir!("transfer")?;
let temp_dir = dir.path();
Expand Down Expand Up @@ -164,15 +164,15 @@ async fn test_transfer_scenarios(ctx: &mut DroppableTestContext) -> anyhow::Resu
Ok(())
}

// #[cfg_attr(not(feature = "framework-test"), ignore)]
#[cfg_attr(not(feature = "framework-test"), ignore)]
#[test_context(DroppableTestContext)]
#[serial_test::serial]
async fn test_transfer_archived(ctx: &mut DroppableTestContext) -> anyhow::Result<()> {
env::set_var(
"RUST_LOG",
env::var("RUST_LOG").unwrap_or_else(|_| "debug".into()),
);
env_logger::try_init().ok();
//env_logger::try_init().ok();

let dir = temp_dir!("transfer-archive")?;
let temp_dir = dir.path();
Expand Down

0 comments on commit c2b468e

Please sign in to comment.