@@ -553,7 +553,6 @@ func serializerAnyRecoveryWorkflow(ctx DBOSContext, input any) (any, error) {
553553func TestSerializer (t * testing.T ) {
554554 serializers := map [string ]func () Serializer {
555555 "JSON" : func () Serializer { return NewJSONSerializer () },
556- "Gob" : func () Serializer { return NewGobSerializer () },
557556 }
558557
559558 for serializerName , serializerFactory := range serializers {
@@ -573,15 +572,13 @@ func TestSerializer(t *testing.T) {
573572 RegisterWorkflow (executor , serializerGetEventWorkflow )
574573 RegisterWorkflow (executor , serializerRecoveryWorkflow )
575574 RegisterWorkflow (executor , serializerInterfaceValueWorkflow )
576- if serializerName == "JSON" {
577- // Cannot register "any" workflow with Gob serializer
578- RegisterWorkflow (executor , serializerAnyValueWorkflow )
579- RegisterWorkflow (executor , serializerAnySenderWorkflow )
580- RegisterWorkflow (executor , serializerAnyReceiverWorkflow )
581- RegisterWorkflow (executor , serializerAnySetEventWorkflow )
582- RegisterWorkflow (executor , serializerAnyGetEventWorkflow )
583- RegisterWorkflow (executor , serializerAnyRecoveryWorkflow )
584- }
575+ // Register any-type workflows (JSON-only runtime)
576+ RegisterWorkflow (executor , serializerAnyValueWorkflow )
577+ RegisterWorkflow (executor , serializerAnySenderWorkflow )
578+ RegisterWorkflow (executor , serializerAnyReceiverWorkflow )
579+ RegisterWorkflow (executor , serializerAnySetEventWorkflow )
580+ RegisterWorkflow (executor , serializerAnyGetEventWorkflow )
581+ RegisterWorkflow (executor , serializerAnyRecoveryWorkflow )
585582
586583 err := Launch (executor )
587584 require .NoError (t , err )
@@ -606,9 +603,6 @@ func TestSerializer(t *testing.T) {
606603
607604 // Test workflow with any type and comprehensive data structure
608605 t .Run ("ComprehensiveAnyValues" , func (t * testing.T ) {
609- if serializerName == "Gob" {
610- t .Skip ("Skipping test for Gob serializer due to Gob limitations with interface types" )
611- }
612606 input := TestWorkflowData {
613607 ID : "any-test-id" ,
614608 Message : "any test message" ,
@@ -697,9 +691,6 @@ func TestSerializer(t *testing.T) {
697691
698692 // Test nil values with any type workflow
699693 t .Run ("NilValuesAny" , func (t * testing.T ) {
700- if serializerName == "Gob" {
701- t .Skip ("Skipping test for Gob serializer due to Gob limitations with interface types" )
702- }
703694 handle , err := RunWorkflow (executor , serializerAnyValueWorkflow , nil )
704695 require .NoError (t , err , "Nil any workflow execution failed" )
705696
@@ -769,9 +760,6 @@ func TestSerializer(t *testing.T) {
769760
770761 // Test Send/Recv with any type
771762 t .Run ("SendRecvAny" , func (t * testing.T ) {
772- if serializerName == "Gob" {
773- t .Skip ("Skipping test for Gob serializer due to Gob limitations with interface types" )
774- }
775763 input := TestWorkflowData {
776764 ID : "sendrecv-any-test-id" ,
777765 Message : "any test message" ,
@@ -786,9 +774,6 @@ func TestSerializer(t *testing.T) {
786774
787775 // Test SetEvent/GetEvent with any type
788776 t .Run ("SetGetEventAny" , func (t * testing.T ) {
789- if serializerName == "Gob" {
790- t .Skip ("Skipping test for Gob serializer due to Gob limitations with interface types" )
791- }
792777 input := TestWorkflowData {
793778 ID : "event-any-test-id" ,
794779 Message : "any event message" ,
@@ -820,9 +805,6 @@ func TestSerializer(t *testing.T) {
820805
821806 // Test workflow recovery with any type
822807 t .Run ("WorkflowRecoveryAny" , func (t * testing.T ) {
823- if serializerName == "Gob" {
824- t .Skip ("Skipping test for Gob serializer due to Gob limitations with interface types" )
825- }
826808
827809 serializerAnyRecoveryStartEvent = NewEvent ()
828810 serializerAnyRecoveryEvent = NewEvent ()
@@ -862,9 +844,6 @@ func TestSerializer(t *testing.T) {
862844
863845 // Test queued workflow with any type
864846 t .Run ("QueuedWorkflowAny" , func (t * testing.T ) {
865- if serializerName == "Gob" {
866- t .Skip ("Skipping test for Gob serializer due to Gob limitations with interface types" )
867- }
868847
869848 input := TestWorkflowData {
870849 ID : "queued-any-test-id" ,
@@ -896,7 +875,6 @@ func TestSerializer(t *testing.T) {
896875// Test serializer interface compliance
897876func TestSerializerInterface (t * testing.T ) {
898877 // Test that both serializers implement the Serializer interface
899- var _ Serializer = (* GobSerializer )(nil )
900878 var _ Serializer = (* JSONSerializer )(nil )
901879}
902880
@@ -920,25 +898,9 @@ func TestSerializerConfiguration(t *testing.T) {
920898 }
921899 })
922900
923- // Test Gob serializer configuration
924- t .Run ("GobSerializer" , func (t * testing.T ) {
925- config := Config {
926- DatabaseURL : getDatabaseURL (),
927- AppName : "test-app" ,
928- Serializer : NewGobSerializer (),
929- }
930-
931- executor , err := NewDBOSContext (context .Background (), config )
932- require .NoError (t , err , "Failed to create DBOS context with Gob serializer" )
933-
934- // Verify the serializer is set in the context
935- if dbosCtx , ok := executor .(* dbosContext ); ok {
936- assert .NotNil (t , dbosCtx .serializer , "Gob serializer should be configured" )
937- assert .IsType (t , & GobSerializer {}, dbosCtx .serializer , "Should be GobSerializer type" )
938- }
939- })
901+ // Removed Gob serializer configuration test
940902
941- // Test default serializer (should be Gob )
903+ // Test default serializer (should be JSON )
942904 t .Run ("DefaultSerializer" , func (t * testing.T ) {
943905 config := Config {
944906 DatabaseURL : getDatabaseURL (),
@@ -952,7 +914,7 @@ func TestSerializerConfiguration(t *testing.T) {
952914 // Verify the default serializer is Gob
953915 if dbosCtx , ok := executor .(* dbosContext ); ok {
954916 assert .NotNil (t , dbosCtx .serializer , "Default serializer should be configured" )
955- assert .IsType (t , & GobSerializer {}, dbosCtx .serializer , "Default should be GobSerializer " )
917+ assert .IsType (t , & JSONSerializer {}, dbosCtx .serializer , "Default should be JSONSerializer " )
956918 }
957919 })
958920}
0 commit comments