internal/jsonrpc2_v2,mcp: remove unneeded dependencies

Remove dependencies on the eventtest and testenv packages from
jsonrpc2_v2 and mcp packages, in preparation for forking.

Change-Id: Id0efb0c3187629f6fb1822cc853ec52acea41b0d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/682696
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Rob Findley 2025-06-19 00:29:02 +00:00 • committed by Gopher Robot
commit 8bc9a9a9f5

View file

@ -12,9 +12,7 @@ import (
"reflect"
"testing"
"golang.org/x/tools/internal/event/export/eventtest"
"github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2"
"golang.org/x/tools/internal/stack/stacktest"
)
var callTests = []invoker{
@ -130,8 +128,7 @@ func TestConnectionHeader(t *testing.T) {
}
func testConnection(t *testing.T, framer jsonrpc2.Framer) {
stacktest.NoLeak(t)
ctx := eventtest.NewContext(context.Background(), t)
ctx := context.Background()
listener, err := jsonrpc2.NetPipeListener(ctx)
if err != nil {
t.Fatal(err)
@ -147,7 +144,6 @@ func testConnection(t *testing.T, framer jsonrpc2.Framer) {
client, err := jsonrpc2.Dial(ctx,
listener.Dialer(), binder{framer, func(h *handler) {
defer h.conn.Close()
ctx := eventtest.NewContext(ctx, t)
test.Invoke(t, ctx, h)
if call, ok := test.(*call); ok {
// also run all simple call tests in echo mode