Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ require (
github.com/stretchr/testify v1.11.1
github.com/temporalio/features v0.0.0-20260427223549-86e4c0deedd7
github.com/temporalio/omes/workers/go/harness/api v0.0.0-00010101000000-000000000000
go.temporal.io/api v1.62.11
go.temporal.io/sdk v1.43.0
go.temporal.io/api v1.62.12
go.temporal.io/sdk v1.44.0
go.uber.org/zap v1.27.0
golang.org/x/mod v0.31.0
golang.org/x/sync v0.19.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2W
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
go.temporal.io/api v1.62.11 h1:MWDaooDvOJCIRb1atqeZX2ErDPNTsNc3/mMEVEvvaVU=
go.temporal.io/api v1.62.11/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
go.temporal.io/sdk v1.43.0 h1:jHX/T2ZyBVjAtpQ/69NoMS6a+J0CpJAe+naqSB1gkvY=
go.temporal.io/sdk v1.43.0/go.mod h1:w9XuJzV25JhnJqUzxJWJISpp5q/EyeCtRKHvhW3lIoQ=
go.temporal.io/api v1.62.12 h1:627rVnItegQmrszg1bH4vfyc/1uNo5qCereCNkvZefw=
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

smol mod tidy

go.temporal.io/api v1.62.12/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
go.temporal.io/sdk v1.44.0 h1:suitPDukX74rW3/N1FqvEbZTZVJJsxMKhv0KMa/j7pU=
go.temporal.io/sdk v1.44.0/go.mod h1:vkApR12F9/Y8OR+hkxe7WyXQFuCX6clhzqnAk6rzDAM=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down
76 changes: 75 additions & 1 deletion loadgen/kitchen_sink_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ var (
clioptions.LangTypeScript: "executenexusoperation is not supported",
clioptions.LangDotNet: "executenexusoperation is not supported",
}

standaloneNexusUnsupportedSDKs = map[clioptions.Language]string{
clioptions.LangJava: "dostandalonenexusoperation is not supported",
clioptions.LangPython: "dostandalonenexusoperation is not supported",
clioptions.LangRuby: "dostandalonenexusoperation is not supported",
clioptions.LangTypeScript: "dostandalonenexusoperation is not supported",
clioptions.LangDotNet: "dostandalonenexusoperation is not supported",
}
)

type testCase struct {
Expand All @@ -59,7 +67,12 @@ func TestKitchenSink(t *testing.T) {
if os.Getenv("CI") != "" && onlySDK == "" {
t.Skip("Skipping kitchensink test in CI without specific SDK set")
}
env := SetupTestEnvironment(t)
env := SetupTestEnvironment(t, WithDynamicConfig(map[string]any{
// Enable StartNexusOperationExecution for the standalone-nexus subtests.
"nexusoperation.enableStandalone": true,
// Standalone Nexus system callbacks require CHASM callbacks.
"history.enableCHASMCallbacks": true,
}))

// Default workflow execution timeout for tests
defaultWorkflowTimeout := 30 * time.Second
Expand Down Expand Up @@ -969,6 +982,58 @@ func TestKitchenSink(t *testing.T) {
WorkflowExecutionCompleted`),
expectedUnsupportedErrs: nexusUnsupportedSDKs,
},
{
name: "ExecActivity/Client/StandaloneNexusOperation/Async",
testInput: &TestInput{
WorkflowInput: &WorkflowInput{
InitialActions: ListActionSet(
ClientActivity(
ClientActions(&ClientAction{
Variant: &ClientAction_DoStandaloneNexusOperation{
DoStandaloneNexusOperation: &DoStandaloneNexusOperation{
// Endpoint filled by PrepareTestInput
Service: "kitchen-sink",
Operation: "echo-async",
},
},
}),
DefaultRemoteActivity,
),
),
},
},
historyMatcher: PartialHistoryMatcher(`
ActivityTaskScheduled {"activityType":{"name":"client"}}
ActivityTaskStarted
ActivityTaskCompleted`),
expectedUnsupportedErrs: standaloneNexusUnsupportedSDKs,
},
{
name: "ExecActivity/Client/StandaloneNexusOperation/Sync",
testInput: &TestInput{
WorkflowInput: &WorkflowInput{
InitialActions: ListActionSet(
ClientActivity(
ClientActions(&ClientAction{
Variant: &ClientAction_DoStandaloneNexusOperation{
DoStandaloneNexusOperation: &DoStandaloneNexusOperation{
// Endpoint filled by PrepareTestInput
Service: "kitchen-sink",
Operation: "echo-sync",
},
},
}),
DefaultRemoteActivity,
),
),
},
},
historyMatcher: PartialHistoryMatcher(`
ActivityTaskScheduled {"activityType":{"name":"client"}}
ActivityTaskStarted
ActivityTaskCompleted`),
expectedUnsupportedErrs: standaloneNexusUnsupportedSDKs,
},
{
name: "UnsupportedAction",
testInput: &TestInput{
Expand Down Expand Up @@ -1044,6 +1109,15 @@ func testForSDK(
if nexusOp := action.GetNexusOperation(); nexusOp != nil && nexusOp.Endpoint == "" {
nexusOp.Endpoint = nexusEndpoint
}
if clientSeq := action.GetExecActivity().GetClient().GetClientSequence(); clientSeq != nil {
for _, cas := range clientSeq.ActionSets {
for _, ca := range cas.Actions {
if sno := ca.GetDoStandaloneNexusOperation(); sno != nil && sno.Endpoint == "" {
sno.Endpoint = nexusEndpoint
}
}
}
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The endpoint isn't available at the time the testInput is created and we therefore have to patch it here. We could change the test input to come from a closure and pass in the endpoint there; but not sure that's worth it.

}
}
}
Expand Down
29 changes: 29 additions & 0 deletions loadgen/kitchensink/client_action_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"time"

"github.com/google/uuid"
enumspb "go.temporal.io/api/enums/v1"
"go.temporal.io/sdk/client"
"go.temporal.io/sdk/workflow"
Expand All @@ -14,6 +15,7 @@ import (

type ClientActionsExecutor struct {
Client client.Client
Namespace string
WorkflowOptions client.StartWorkflowOptions
WorkflowType string
WorkflowInput *WorkflowInput
Expand Down Expand Up @@ -127,6 +129,8 @@ func (e *ClientActionsExecutor) executeClientAction(ctx context.Context, action
} else if action.GetNestedActions() != nil {
err = e.executeClientActionSet(ctx, action.GetNestedActions())
return err
} else if sano := action.GetDoStandaloneNexusOperation(); sano != nil {
return e.executeStandaloneNexusOperation(ctx, sano)
} else {
return fmt.Errorf("client action must be set")
}
Expand Down Expand Up @@ -196,3 +200,28 @@ func (e *ClientActionsExecutor) executeUpdateAction(ctx context.Context, upd *Do
}
return run, err
}

func (e *ClientActionsExecutor) executeStandaloneNexusOperation(ctx context.Context, sno *DoStandaloneNexusOperation) error {
operationID := fmt.Sprintf("standalone-nexus-%s-%s", e.WorkflowOptions.ID, uuid.NewString())
nexusClient, err := e.Client.NewNexusClient(client.NexusClientOptions{
Endpoint: sno.Endpoint,
Service: sno.Service,
})
if err != nil {
return fmt.Errorf("NewNexusClient: %w", err)
}

handle, err := nexusClient.ExecuteOperation(ctx, sno.Operation, &NexusHandlerInput{}, client.StartNexusOperationOptions{
ID: operationID,
ScheduleToCloseTimeout: 90 * time.Second,
})
if err != nil {
return fmt.Errorf("ExecuteOperation: %w", err)
}

err = handle.Get(ctx, nil)
if err != nil {
return fmt.Errorf("Get standalone nexus operation: %w", err)
}
return nil
}
Loading
Loading