Skip to content

Adding tests for WorkflowQuery as a Nexus Op - #460

Open
mavemuri wants to merge 2 commits into
mainfrom
NEXUS-692
Open

Adding tests for WorkflowQuery as a Nexus Op#460
mavemuri wants to merge 2 commits into
mainfrom
NEXUS-692

Conversation

@mavemuri

@mavemuri mavemuri commented Sep 2, 2026

Copy link
Copy Markdown

What was changed

Added tests for Query as a Nexus Op

Why?

part of the SDK ergonomics efforts

Checklist

  1. Closes NEXUS-692

  2. How was this tested: tested locally

  3. Any docs updates needed? No

@mavemuri
mavemuri requested review from a team as code owners September 2, 2026 00:33
Comment thread loadgen/kitchensink/helpers.go Outdated
Comment thread workers/go/workerlib/kitchensink/kitchen_sink.go Outdated
Comment thread workers/go/workerlib/kitchensink/kitchen_sink.go Outdated
Comment thread internal/workertest/historyrequire.go Outdated
Comment thread loadgen/kitchensink/helpers.go Outdated
Comment thread loadgen/kitchen_sink_executor_test.go Outdated
Comment thread workers/go/workerlib/kitchensink/kitchen_sink.go Outdated
Comment thread workers/go/workerlib/kitchensink/kitchen_sink.go Outdated
Comment thread workers/go/workerlib/kitchensink/kitchen_sink.go Outdated
Comment thread workers/go/workerlib/kitchensink/kitchen_sink.go Outdated
@mavemuri
mavemuri requested a review from stephanos September 2, 2026 20:54
@mavemuri mavemuri changed the title NEXUS-692: tests for WorkflowQuery as a Nexus Op Adding tests for WorkflowQuery as a Nexus Op Sep 3, 2026
)

// QueryWorkflowTarget identifies the workflow that the "query-workflow" Nexus operation queries.
// Only WorkflowID is required

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit

Suggested change
// Only WorkflowID is required
// WorkflowID is required.

historyMatcher HistoryMatcher
expectedUnsupportedErrs map[clioptions.Language]string
expectedWorkflowError string
populateFn func(t *testing.T) testCase

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hm, I don't love it. I think maybe this was the wrong direction; instead we should isolate the SDK runs by using separate namespaces. I noodled a bit one it and came up with this: #462

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Agree, per-SDK ns is cleaner - thanks for raising the pr

Comment on lines +289 to +292
for i, yv := range yList {
if !looselyEqual(x[i], yv) {
return false
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's fine with me; can we tighten the comment there?

// Match the unordered expected list so a spec can
// assert only what it knows. Eg, when asserting links, if runID is
// not known, it should be possible to assert on just WID+NS

I don't quite understand what it's saying tbh. Esp. since they are not "unordered".

I'd omit it or add a shorter comment maybe on if !looselyEqual(x[i], yv) { to explain that this recurses into list elements (if that's what it means to say). Or drop the comment.

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.

2 participants