@@ -300,7 +300,7 @@ def expect_signal_with_start(expected_arguments, expected_signal_argument)
300
300
it 'raises when signal_input is given but signal_name is not' do
301
301
expect do
302
302
subject . start_workflow (
303
- TestStartWorkflow ,
303
+ TestStartWorkflow ,
304
304
[ 42 , 54 ] ,
305
305
[ 43 , 55 ] ,
306
306
options : { signal_input : 'what do you get if you multiply six by nine?' , }
@@ -361,7 +361,7 @@ def expect_signal_with_start(expected_arguments, expected_signal_argument)
361
361
362
362
describe '#describe_namespace' do
363
363
before { allow ( connection ) . to receive ( :describe_namespace ) . and_return ( Temporalio ::Api ::WorkflowService ::V1 ::DescribeNamespaceResponse . new ) }
364
-
364
+
365
365
it 'passes the namespace to the connection' do
366
366
result = subject . describe_namespace ( 'new-namespace' )
367
367
@@ -381,7 +381,7 @@ def expect_signal_with_start(expected_arguments, expected_signal_argument)
381
381
. to have_received ( :signal_workflow_execution )
382
382
. with (
383
383
namespace : 'default-test-namespace' ,
384
- signal : 'signal' ,
384
+ signal : 'signal' ,
385
385
workflow_id : 'workflow_id' ,
386
386
run_id : 'run_id' ,
387
387
input : nil ,
@@ -395,7 +395,7 @@ def expect_signal_with_start(expected_arguments, expected_signal_argument)
395
395
. to have_received ( :signal_workflow_execution )
396
396
. with (
397
397
namespace : 'default-test-namespace' ,
398
- signal : 'signal' ,
398
+ signal : 'signal' ,
399
399
workflow_id : 'workflow_id' ,
400
400
run_id : 'run_id' ,
401
401
input : 'input' ,
@@ -409,7 +409,7 @@ def expect_signal_with_start(expected_arguments, expected_signal_argument)
409
409
. to have_received ( :signal_workflow_execution )
410
410
. with (
411
411
namespace : 'other-test-namespace' ,
412
- signal : 'signal' ,
412
+ signal : 'signal' ,
413
413
workflow_id : 'workflow_id' ,
414
414
run_id : 'run_id' ,
415
415
input : nil ,
@@ -449,7 +449,7 @@ class NamespacedWorkflow < Temporal::Workflow
449
449
)
450
450
end
451
451
452
- it 'can override the namespace' do
452
+ it 'can override the namespace' do
453
453
completed_event = Fabricate ( :workflow_completed_event , result : nil )
454
454
response = Fabricate ( :workflow_execution_history , events : [ completed_event ] )
455
455
@@ -534,7 +534,7 @@ class NamespacedWorkflow < Temporal::Workflow
534
534
end . to raise_error ( Temporal ::WorkflowCanceled )
535
535
end
536
536
537
- it 'raises TimeoutError when the server times out' do
537
+ it 'raises TimeoutError when the server times out' do
538
538
response = Fabricate ( :workflow_execution_history , events : [ ] )
539
539
expect ( connection )
540
540
. to receive ( :get_workflow_execution_history )
@@ -895,6 +895,32 @@ class NamespacedWorkflow < Temporal::Workflow
895
895
end
896
896
end
897
897
898
+ describe '#get_workflow_history' do
899
+ it 'gets full history with pagination' do
900
+ completed_event = Fabricate ( :workflow_completed_event , result : nil )
901
+ response_1 = Fabricate ( :workflow_execution_history , events : [ completed_event ] , next_page_token : 'a' )
902
+ response_2 = Fabricate ( :workflow_execution_history , events : [ completed_event ] , next_page_token : '' )
903
+
904
+ allow ( connection )
905
+ . to receive ( :get_workflow_execution_history )
906
+ . and_return ( response_1 , response_2 )
907
+
908
+ subject . get_workflow_history ( namespace : namespace , workflow_id : workflow_id , run_id : run_id )
909
+
910
+ expect ( connection )
911
+ . to have_received ( :get_workflow_execution_history )
912
+ . with ( namespace : namespace , workflow_id : workflow_id , run_id : run_id , next_page_token : nil )
913
+ . ordered
914
+
915
+ expect ( connection )
916
+ . to have_received ( :get_workflow_execution_history )
917
+ . with ( namespace : namespace , workflow_id : workflow_id , run_id : run_id , next_page_token : 'a' )
918
+ . ordered
919
+
920
+ expect ( connection ) . to have_received ( :get_workflow_execution_history ) . exactly ( 2 ) . times
921
+ end
922
+ end
923
+
898
924
describe '#list_open_workflow_executions' do
899
925
let ( :from ) { Time . now - 600 }
900
926
let ( :now ) { Time . now }
@@ -977,7 +1003,7 @@ class NamespacedWorkflow < Temporal::Workflow
977
1003
end
978
1004
end
979
1005
980
- it 'returns the next page token and paginates correctly' do
1006
+ it 'returns the next page token and paginates correctly' do
981
1007
executions1 = subject . list_open_workflow_executions ( namespace , from , max_page_size : 10 )
982
1008
executions1 . map do |execution |
983
1009
expect ( execution ) . to be_an_instance_of ( Temporal ::Workflow ::ExecutionInfo )
@@ -1009,7 +1035,7 @@ class NamespacedWorkflow < Temporal::Workflow
1009
1035
. once
1010
1036
end
1011
1037
1012
- it 'returns the next page and paginates correctly' do
1038
+ it 'returns the next page and paginates correctly' do
1013
1039
executions1 = subject . list_open_workflow_executions ( namespace , from , max_page_size : 10 )
1014
1040
executions1 . map do |execution |
1015
1041
expect ( execution ) . to be_an_instance_of ( Temporal ::Workflow ::ExecutionInfo )
0 commit comments