@@ -597,7 +597,7 @@ mod tests {
597597 use assert_matches:: assert_matches;
598598 use chrono:: DateTime ;
599599 use concepts:: component_id:: { COMPONENT_DIGEST_DUMMY , ComponentDigest , Digest } ;
600- use concepts:: prefixed_ulid:: { DEPLOYMENT_ID_DUMMY , DelayId , ExecutorId , RunId } ;
600+ use concepts:: prefixed_ulid:: { DEPLOYMENT_ID_DUMMY , DelayId , DeploymentId , ExecutorId , RunId } ;
601601 use concepts:: storage:: {
602602 CapturedDbWrite , ComponentUpgradeOutcome , ComponentUpgradeReason , CreateRequest ,
603603 DbConnectionTest , DbPool , DbPoolCloseable , ExecutionRequest , HistoryEvent , JoinSetRequest ,
@@ -1059,6 +1059,26 @@ mod tests {
10591059 clock_fn : Box < dyn ClockFn > ,
10601060 fn_registry : Arc < dyn FunctionRegistry > ,
10611061 workflow_engine : Arc < Engine > ,
1062+ ) -> ( WorkflowJsWorker , concepts:: ComponentId , RunnableComponent ) {
1063+ compile_js_workflow_worker_with_deployment_id (
1064+ js_source,
1065+ user_ffqn,
1066+ db_pool,
1067+ clock_fn,
1068+ fn_registry,
1069+ workflow_engine,
1070+ DEPLOYMENT_ID_DUMMY ,
1071+ )
1072+ }
1073+
1074+ fn compile_js_workflow_worker_with_deployment_id (
1075+ js_source : & str ,
1076+ user_ffqn : & FunctionFqn ,
1077+ db_pool : Arc < dyn DbPool > ,
1078+ clock_fn : Box < dyn ClockFn > ,
1079+ fn_registry : Arc < dyn FunctionRegistry > ,
1080+ workflow_engine : Arc < Engine > ,
1081+ deployment_id : DeploymentId ,
10621082 ) -> ( WorkflowJsWorker , concepts:: ComponentId , RunnableComponent ) {
10631083 let wasm_path = workflow_js_runtime_builder:: WORKFLOW_JS_RUNTIME ;
10641084 let params = default_js_params ( ) ;
@@ -1108,7 +1128,7 @@ mod tests {
11081128
11091129 (
11101130 linked. into_worker (
1111- DEPLOYMENT_ID_DUMMY ,
1131+ deployment_id ,
11121132 db_pool,
11131133 deadline_factory,
11141134 CancelRegistry :: new ( ) ,
@@ -2575,6 +2595,8 @@ mod tests {
25752595 let ( _guard, db_pool, db_close) = database. set_up ( ) . await ;
25762596 let sim_clock = SimClock :: epoch ( ) ;
25772597 let user_ffqn = FunctionFqn :: new_static ( "test:pkg/ifc" , "test-auto-locking-failure" ) ;
2598+ let original_deployment_id = DeploymentId :: from_parts ( 0 , 9009 ) ;
2599+ let upgrade_deployment_id = DeploymentId :: from_parts ( 0 , 9010 ) ;
25782600 let original_js_source = r"
25792601 export default function test_auto_locking_failure(params) {
25802602 obelisk.sleep({ milliseconds: 10 });
@@ -2594,22 +2616,25 @@ mod tests {
25942616 let workflow_engine =
25952617 Engines :: get_workflow_engine_test ( EngineConfig :: on_demand_testing ( ) ) . unwrap ( ) ;
25962618 let ( original_worker, original_component_id, _original_runnable) =
2597- compile_js_workflow_worker (
2619+ compile_js_workflow_worker_with_deployment_id (
25982620 original_js_source,
25992621 & user_ffqn,
26002622 db_pool. clone ( ) ,
26012623 sim_clock. clone_box ( ) ,
26022624 fn_registry. clone ( ) ,
26032625 workflow_engine. clone ( ) ,
2626+ original_deployment_id,
2627+ ) ;
2628+ let ( upgrade_worker, upgrade_component_id, _upgrade_runnable) =
2629+ compile_js_workflow_worker_with_deployment_id (
2630+ failing_upgrade_js_source,
2631+ & user_ffqn,
2632+ db_pool. clone ( ) ,
2633+ sim_clock. clone_box ( ) ,
2634+ fn_registry,
2635+ workflow_engine,
2636+ upgrade_deployment_id,
26042637 ) ;
2605- let ( upgrade_worker, upgrade_component_id, _upgrade_runnable) = compile_js_workflow_worker (
2606- failing_upgrade_js_source,
2607- & user_ffqn,
2608- db_pool. clone ( ) ,
2609- sim_clock. clone_box ( ) ,
2610- fn_registry,
2611- workflow_engine,
2612- ) ;
26132638 assert_ne ! (
26142639 original_component_id. component_digest,
26152640 upgrade_component_id. component_digest
@@ -2644,8 +2669,8 @@ mod tests {
26442669 parent : None ,
26452670 metadata : ExecutionMetadata :: empty ( ) ,
26462671 scheduled_at : created_at,
2647- component_id : original_component_id,
2648- deployment_id : DEPLOYMENT_ID_DUMMY ,
2672+ component_id : original_component_id. clone ( ) ,
2673+ deployment_id : original_deployment_id ,
26492674 scheduled_by : None ,
26502675 paused : false ,
26512676 } )
@@ -2677,6 +2702,8 @@ mod tests {
26772702 ) ;
26782703
26792704 let log = db_connection. get ( & execution_id) . await . unwrap ( ) ;
2705+ assert_eq ! ( original_deployment_id, log. deployment_id) ;
2706+ assert_eq ! ( original_component_id. component_digest, log. component_digest) ;
26802707 assert_eq ! ( 8 , log. events. len( ) ) ;
26812708 assert_matches ! ( & log. events[ 0 ] . event, ExecutionRequest :: Created { .. } ) ;
26822709 assert_matches ! ( & log. events[ 1 ] . event, ExecutionRequest :: Locked ( _) ) ;
0 commit comments