From adba79d131f64b2c3dd5401c59a699ff740bf6f8 Mon Sep 17 00:00:00 2001 From: "nieznany.sprawiciel" Date: Mon, 9 Sep 2024 12:59:38 +0200 Subject: [PATCH] Fix tests; Add ignored http proxy tests under framework-test feature flag to system-tests --- Cargo.toml | 2 +- core/activity/Cargo.toml | 3 +++ exe-unit/components/gsb-http-proxy/Cargo.toml | 3 +++ exe-unit/components/gsb-http-proxy/src/gsb_to_http.rs | 6 ++++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 92cb2b0584..e8a29291f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ static-openssl = ["openssl/vendored", "openssl-probe"] dummy-driver = ['ya-dummy-driver'] erc20-driver = ['ya-erc20-driver'] tos = [] -framework-test = ['ya-exe-unit/framework-test'] +framework-test = ['ya-exe-unit/framework-test', 'ya-activity/framework-test'] # Temporary to make goth integration tests work central-net = ['ya-net/central-net'] packet-trace-enable = [ diff --git a/core/activity/Cargo.toml b/core/activity/Cargo.toml index d3e0fc8d6f..3511fbbfb1 100644 --- a/core/activity/Cargo.toml +++ b/core/activity/Cargo.toml @@ -4,6 +4,9 @@ version = "0.4.0" authors = ["Golem Factory "] edition = "2018" +[features] +framework-test = ['ya-gsb-http-proxy/framework-test'] + [dependencies] ya-core-model = { version = "0.9", features = ["activity", "market"] } ya-client-model = { version = "0.6", features = ["sgx"] } diff --git a/exe-unit/components/gsb-http-proxy/Cargo.toml b/exe-unit/components/gsb-http-proxy/Cargo.toml index a283b69e0f..c399b7e02b 100644 --- a/exe-unit/components/gsb-http-proxy/Cargo.toml +++ b/exe-unit/components/gsb-http-proxy/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" edition = "2021" +[features] +framework-test = [] + [dependencies] ya-service-bus = { workspace = true } ya-counters = { path = "../counters" } diff --git a/exe-unit/components/gsb-http-proxy/src/gsb_to_http.rs b/exe-unit/components/gsb-http-proxy/src/gsb_to_http.rs index d2343f0faa..2e9c5dcb80 100644 --- a/exe-unit/components/gsb-http-proxy/src/gsb_to_http.rs +++ b/exe-unit/components/gsb-http-proxy/src/gsb_to_http.rs @@ -285,8 +285,9 @@ mod tests { let mut requests_counter = gsb_call.requests_counter(); let mut requests_duration_counter = gsb_call.requests_duration_counter(); + let caller = "0x0000000000000000000000000000000000000000".to_string(); let message = message(); - let response = gsb_call.pass(message).await; + let response = gsb_call.pass(caller.clone(), message).await; let mut headers = vec![]; @@ -390,9 +391,10 @@ mod tests { async fn run_10_requests(mut gsb_call_proxy: GsbToHttpProxy) { let message = message(); + let caller = "0x0000000000000000000000000000000000000000".to_string(); for _ in 0..10 { let message = message.clone(); - let response = gsb_call_proxy.pass(message).await; + let response = gsb_call_proxy.pass(caller.clone(), message).await; assert_eq!("response".as_bytes(), response.body.msg_bytes); } }