tests: migrate callbacks_test.go to TestEnv#10330
Merged
Merged
Conversation
4f9daf1 to
466fd9b
Compare
stephanos
reviewed
May 19, 2026
| } | ||
|
|
||
| func (s *CallbacksSuite) runNexusCompletionHTTPServer(t *testing.T, h *completionHandler) string { | ||
| func runNexusCompletionHTTPServer(t *testing.T, h *completionHandler) string { |
Contributor
There was a problem hiding this comment.
Could we make this a helper method on the suite? With free floating functions we always run a risk of conflicts with other files in this large package.
stephanos
approved these changes
May 19, 2026
Contributor
stephanos
left a comment
There was a problem hiding this comment.
Nothing blocking, just some recommendations
Comment on lines
+110
to
+118
| env := testcore.NewEnv(s.T(), opts...) | ||
| env.OverrideDynamicConfig(dynamicconfig.FrontendCallbackURLMaxLength, 50) | ||
| env.OverrideDynamicConfig(dynamicconfig.FrontendCallbackHeaderMaxSize, 6) | ||
| env.OverrideDynamicConfig(dynamicconfig.MaxCallbacksPerWorkflow, 2) | ||
| env.OverrideDynamicConfig(callback.MaxPerExecution, 2) | ||
| env.OverrideDynamicConfig( | ||
| callback.AllowedAddresses, | ||
| []any{map[string]any{"Pattern": "some-ignored-address", "AllowInsecure": true}, map[string]any{"Pattern": "some-secure-address", "AllowInsecure": false}}, | ||
| ) |
Contributor
There was a problem hiding this comment.
Some of the other suites have this pattern of having a
func (s *NexusWorkflowTestSuite) newTestEnv(opts ...testcore.TestOption) *NexusTestEnv { }which I think makes this a little nice/shorter.
| } | ||
|
|
||
| _, err := s.FrontendClient().StartWorkflowExecution(ctx, request) | ||
| _, err := env.FrontendClient().StartWorkflowExecution(env.Context(), request) |
Contributor
There was a problem hiding this comment.
Should we now use s.Context() everywhere? I didn't mark this one as deprecated yet as it's the only way to do it outside of parallelsuite.
Comment on lines
+199
to
+202
| env.OverrideDynamicConfig( | ||
| callback.AllowedAddresses, | ||
| []any{map[string]any{"Pattern": "*", "AllowInsecure": true}}, | ||
| ) |
Contributor
There was a problem hiding this comment.
If we had newTestEnv this could maybe be the default
|
|
||
| s.EventuallyWithT( | ||
| func(t *assert.CollectT) { | ||
| await.Require(s.Context(), s.T(), |
6b6932d to
805f3e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
WISOTT
Why?
Part of our migration process to testcore.TestEnv for reliability and speed purposes.
How did you test it?
Potential risks
None, test file changes only