You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcptest): Change Server.Start to accept a context.Context. (#339)
* feat(mcptest): Change `Server.Start` to accept a `context.Context`.
Previously, `mcptest` used `context.TODO()` as the context with this server
code was executed (with a comment to upgrade to `testing.T.Context()`
eventually.
This effectively prevents tests from preparing a context to be used with server
code. This is imporant, because `WithHTTPContextFunc` and friends appear to be
the intended way to extract things like authentication information from the raw
HTTP request and pass it to the server code. Without this change, such code is
effectively untestable, at least with this package.
The `NewServer` convenience method has been left unchanged (i.e. it does not
accept a context) to avoid breaking users taking the happy path. Chaning the
signature of `Start()` is however a breaking change.
* test(mcptest): Update tests to use the new `Start()` signature.
---------
Co-authored-by: Navendu Pottekkat <[email protected]>
0 commit comments