From 2bb76aecf41c894eab8a9585c346f37b8a7fe82f Mon Sep 17 00:00:00 2001 From: Harsha Teja Kanna Date: Sat, 25 Nov 2023 15:13:42 -0600 Subject: [PATCH] Add feature for ephemeral server usage in test utils --- test-utils/Cargo.toml | 6 +++++- test-utils/src/lib.rs | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 4c046d660..46820d12d 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -8,6 +8,10 @@ edition = "2021" name = "histfetch" path = "src/histfetch.rs" +[features] +default = ["ephemeral-server"] +ephemeral-server = ["temporal-sdk-core/ephemeral-server"] + [dependencies] anyhow = "1.0" async-trait = "0.1" @@ -24,7 +28,7 @@ rmp-serde = "1.1" serde_json = "1.0" temporal-client = { path = "../client" } temporal-sdk = { path = "../sdk" } -temporal-sdk-core = { path = "../core", features = ["ephemeral-server"] } +temporal-sdk-core = { path = "../core" } temporal-sdk-core-api = { path = "../core-api" } thiserror = "1.0" tokio = "1.1" diff --git a/test-utils/src/lib.rs b/test-utils/src/lib.rs index f4b97ec3e..17eddc6d7 100644 --- a/test-utils/src/lib.rs +++ b/test-utils/src/lib.rs @@ -33,8 +33,9 @@ use temporal_sdk::{ interceptors::{FailOnNondeterminismInterceptor, WorkerInterceptor}, IntoActivityFunc, Worker, WorkflowFunction, }; +#[cfg(feature = "ephemeral-server")] +use temporal_sdk_core::ephemeral_server::{EphemeralExe, EphemeralExeVersion}; use temporal_sdk_core::{ - ephemeral_server::{EphemeralExe, EphemeralExeVersion}, init_replay_worker, init_worker, replay::ReplayWorkerInput, telemetry::{build_otlp_metric_exporter, start_prometheus_metric_exporter}, @@ -675,6 +676,7 @@ pub fn get_integ_telem_options() -> TelemetryOptions { .unwrap() } +#[cfg(feature = "ephemeral-server")] pub fn default_cached_download() -> EphemeralExe { EphemeralExe::CachedDownload { version: EphemeralExeVersion::SDKDefault {