@@ -12,13 +12,13 @@ use std::{
12
12
time:: Duration ,
13
13
} ;
14
14
use temporal_client:: WorkflowOptions ;
15
- use temporal_sdk:: TestRustWorker ;
15
+ use temporal_sdk:: Worker ;
16
16
use temporal_sdk_core:: {
17
17
init_replay_worker, init_worker, replay:: mock_gateway_from_history, telemetry_init,
18
18
ServerGatewayOptions , ServerGatewayOptionsBuilder , TelemetryOptions , TelemetryOptionsBuilder ,
19
19
WorkerConfig , WorkerConfigBuilder ,
20
20
} ;
21
- use temporal_sdk_core_api:: Worker ;
21
+ use temporal_sdk_core_api:: Worker as CoreWorker ;
22
22
use temporal_sdk_core_protos:: {
23
23
coresdk:: {
24
24
workflow_commands:: {
@@ -40,7 +40,7 @@ const PROM_ENABLE_ENV_VAR: &str = "TEMPORAL_INTEG_PROM_PORT";
40
40
41
41
/// Create a worker instance which will use the provided test name to base the task queue and wf id
42
42
/// upon. Returns the instance and the task queue name (which is also the workflow id).
43
- pub async fn init_core_and_create_wf ( test_name : & str ) -> ( Arc < dyn Worker > , String ) {
43
+ pub async fn init_core_and_create_wf ( test_name : & str ) -> ( Arc < dyn CoreWorker > , String ) {
44
44
let mut starter = CoreWfStarter :: new ( test_name) ;
45
45
let core = starter. get_worker ( ) . await ;
46
46
starter. start_wf ( ) . await ;
@@ -49,7 +49,10 @@ pub async fn init_core_and_create_wf(test_name: &str) -> (Arc<dyn Worker>, Strin
49
49
50
50
/// Create a worker replay instance preloaded with a provided history. Returns the worker impl
51
51
/// and the task queue name as in [init_core_and_create_wf].
52
- pub fn init_core_replay_preloaded ( test_name : & str , history : & History ) -> ( Arc < dyn Worker > , String ) {
52
+ pub fn init_core_replay_preloaded (
53
+ test_name : & str ,
54
+ history : & History ,
55
+ ) -> ( Arc < dyn CoreWorker > , String ) {
53
56
let worker_cfg = WorkerConfigBuilder :: default ( )
54
57
. namespace ( NAMESPACE )
55
58
. task_queue ( test_name)
@@ -77,7 +80,7 @@ pub struct CoreWfStarter {
77
80
telemetry_options : TelemetryOptions ,
78
81
worker_config : WorkerConfig ,
79
82
wft_timeout : Option < Duration > ,
80
- initted_worker : Option < Arc < dyn Worker > > ,
83
+ initted_worker : Option < Arc < dyn CoreWorker > > ,
81
84
}
82
85
83
86
impl CoreWfStarter {
@@ -103,8 +106,8 @@ impl CoreWfStarter {
103
106
}
104
107
}
105
108
106
- pub async fn worker ( & mut self ) -> TestRustWorker {
107
- TestRustWorker :: new (
109
+ pub async fn worker ( & mut self ) -> Worker {
110
+ Worker :: new (
108
111
self . get_worker ( ) . await ,
109
112
self . worker_config . task_queue . clone ( ) ,
110
113
self . wft_timeout ,
@@ -115,7 +118,7 @@ impl CoreWfStarter {
115
118
self . get_worker ( ) . await . shutdown ( ) . await ;
116
119
}
117
120
118
- pub async fn get_worker ( & mut self ) -> Arc < dyn Worker > {
121
+ pub async fn get_worker ( & mut self ) -> Arc < dyn CoreWorker > {
119
122
if self . initted_worker . is_none ( ) {
120
123
telemetry_init ( & self . telemetry_options ) . expect ( "Telemetry inits cleanly" ) ;
121
124
let gateway = get_integ_server_options ( )
@@ -163,7 +166,7 @@ impl CoreWfStarter {
163
166
wf_id : impl Into < String > ,
164
167
run_id : impl Into < String > ,
165
168
// TODO: Need not be passed in
166
- worker : & mut TestRustWorker ,
169
+ worker : & mut Worker ,
167
170
) -> Result < ( ) , anyhow:: Error > {
168
171
// Fetch history and replay it
169
172
let history = self
@@ -317,7 +320,7 @@ pub trait WorkerTestHelpers {
317
320
#[ async_trait:: async_trait]
318
321
impl < T > WorkerTestHelpers for T
319
322
where
320
- T : Worker + ?Sized ,
323
+ T : CoreWorker + ?Sized ,
321
324
{
322
325
async fn complete_execution ( & self , run_id : & str ) {
323
326
self . complete_workflow_activation ( WorkflowActivationCompletion :: from_cmds (
0 commit comments