Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nexus links tests #1613

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rodrigozhou
Copy link
Contributor

What was changed

Add Nexus links tests

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@rodrigozhou rodrigozhou requested a review from bergundy August 29, 2024 17:57
@rodrigozhou rodrigozhou requested a review from a team as a code owner August 29, 2024 17:57
@rodrigozhou rodrigozhou marked this pull request as draft August 29, 2024 18:30
Comment on lines +579 to +683
require.Equal(t, tc.testConfig.Namespace, link.GetWorkflowEvent().GetNamespace())
require.Equal(t, handlerWfID, link.GetWorkflowEvent().GetWorkflowId())
require.NotEmpty(t, link.GetWorkflowEvent().GetRunId())
requireProtoEqual(
t,
&common.Link_WorkflowEvent_EventReference{
EventType: enums.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED,
},
link.GetWorkflowEvent().GetEventRef())
handlerRunID := link.GetWorkflowEvent().GetRunId()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could have just used requireProtoEqual on the entire struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot because I don't have the handler run id.

@@ -290,10 +298,22 @@ func TestNexusWorkflowRunOperation(t *testing.T) {

nc := tc.newNexusClient(t, service.Name)

link := &common.Link_WorkflowEvent{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant IMHO since we're already testing adding links from a workflow.

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in the last PR but please mark these functions as experimental in a different PR since this one has to remain a draft until we have a CLI with server 1.26.
https://github.com/temporalio/sdk-go/blob/master/temporalnexus/link_converter.go#L65-L89

@rodrigozhou rodrigozhou force-pushed the rodrigozhou/nexus-test-links branch from a78bfbf to d57a2c5 Compare December 12, 2024 05:14
@rodrigozhou rodrigozhou marked this pull request as ready for review December 12, 2024 05:14
@@ -31,6 +31,7 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
Copy link
Member

@cretz cretz Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth a new test dependency just to show a diff in this one test that should never happen anyways? I think https://pkg.go.dev/google.golang.org/protobuf/proto#Equal should be good enough for this case right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants