Skip to content

Commit

Permalink
check cicd test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigozhou committed Dec 20, 2024
1 parent 255cccf commit df2a7ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ toolchain go1.21.1

require (
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/nexus-rpc/sdk-go v0.1.0
github.com/opentracing/opentracing-go v1.2.0
Expand Down
27 changes: 25 additions & 2 deletions test/nexus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/uuid"
"github.com/nexus-rpc/sdk-go/nexus"
"github.com/stretchr/testify/assert"
Expand All @@ -43,6 +44,7 @@ import (
"go.temporal.io/api/operatorservice/v1"
"go.temporal.io/api/serviceerror"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/testing/protocmp"

"go.temporal.io/sdk/client"
"go.temporal.io/sdk/converter"
Expand All @@ -63,6 +65,12 @@ type testContext struct {
taskQueue, endpoint, endpointBaseURL string
}

func requireProtoEqual(t *testing.T, expected proto.Message, actual proto.Message) {
if diff := cmp.Diff(expected, actual, protocmp.Transform()); diff != "" {
require.Fail(t, "Proto mismatch (-want +got):\n", diff)
}
}

func newTestContext(t *testing.T, ctx context.Context) *testContext {
config := NewConfig()
require.NoError(t, WaitForTCP(time.Minute, config.ServiceAddr))
Expand Down Expand Up @@ -693,7 +701,8 @@ func TestAsyncOperationFromWorkflow(t *testing.T) {
}
require.NotNil(t, targetEvent)
require.Len(t, targetEvent.GetLinks(), 1)
require.True(t, proto.Equal(
requireProtoEqual(
t,
&common.Link_WorkflowEvent{
Namespace: tc.testConfig.Namespace,
WorkflowId: run.GetID(),
Expand All @@ -706,7 +715,21 @@ func TestAsyncOperationFromWorkflow(t *testing.T) {
},
},
targetEvent.GetLinks()[0].GetWorkflowEvent(),
))
)
// require.True(t, proto.Equal(
// &common.Link_WorkflowEvent{
// Namespace: tc.testConfig.Namespace,
// WorkflowId: run.GetID(),
// RunId: run.GetRunID(),
// Reference: &common.Link_WorkflowEvent_EventRef{
// EventRef: &common.Link_WorkflowEvent_EventReference{
// EventId: 5,
// EventType: enums.EVENT_TYPE_NEXUS_OPERATION_SCHEDULED,
// },
// },
// },
// targetEvent.GetLinks()[0].GetWorkflowEvent(),
// ))
})

t.Run("OpFailed", func(t *testing.T) {
Expand Down

0 comments on commit df2a7ce

Please sign in to comment.