File tree Expand file tree Collapse file tree 6 files changed +19
-15
lines changed Expand file tree Collapse file tree 6 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,18 @@ package mcp
33import (
44 "context"
55 "encoding/base64"
6+ "path/filepath"
7+ "runtime"
8+ "strings"
9+ "testing"
10+
611 "github.com/containers/kubernetes-mcp-server/pkg/config"
712 "github.com/mark3labs/mcp-go/mcp"
813 corev1 "k8s.io/api/core/v1"
914 "k8s.io/apimachinery/pkg/api/errors"
1015 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1116 "k8s.io/client-go/kubernetes"
12- "path/filepath"
13- "runtime"
1417 "sigs.k8s.io/yaml"
15- "strings"
16- "testing"
1718)
1819
1920func TestHelmInstall (t * testing.T ) {
Original file line number Diff line number Diff line change 11package mcp
22
33import (
4- "github.com/mark3labs/mcp-go/client/transport"
5- "github.com/mark3labs/mcp-go/mcp"
6- "k8s.io/utils/ptr"
74 "regexp"
85 "strings"
96 "testing"
107
8+ "github.com/mark3labs/mcp-go/client/transport"
9+ "github.com/mark3labs/mcp-go/mcp"
10+ "k8s.io/utils/ptr"
11+
1112 "github.com/containers/kubernetes-mcp-server/pkg/config"
1213)
1314
Original file line number Diff line number Diff line change 11package mcp
22
33import (
4+ "regexp"
5+ "slices"
6+ "testing"
7+
48 "github.com/containers/kubernetes-mcp-server/pkg/config"
59 "github.com/containers/kubernetes-mcp-server/pkg/output"
610 "github.com/mark3labs/mcp-go/mcp"
711 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
812 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
913 "k8s.io/apimachinery/pkg/runtime/schema"
1014 "k8s.io/client-go/dynamic"
11- "regexp"
1215 "sigs.k8s.io/yaml"
13- "slices"
14- "testing"
1516)
1617
1718func TestNamespacesList (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ func TestPodsExec(t *testing.T) {
5858 t .Fatalf ("call tool failed %v" , err )
5959 }
6060 if podsExecNilNamespace .IsError {
61- t .Fatalf ("call tool failed" )
61+ t .Fatalf ("call tool failed: %v" , podsExecNilNamespace . Content )
6262 }
6363 if ! strings .Contains (podsExecNilNamespace .Content [0 ].(mcp.TextContent ).Text , "command:ls -l\n " ) {
6464 t .Errorf ("unexpected result %v" , podsExecNilNamespace .Content [0 ].(mcp.TextContent ).Text )
@@ -74,9 +74,9 @@ func TestPodsExec(t *testing.T) {
7474 t .Fatalf ("call tool failed %v" , err )
7575 }
7676 if podsExecInNamespace .IsError {
77- t .Fatalf ("call tool failed" )
77+ t .Fatalf ("call tool failed: %v" , podsExecInNamespace . Content )
7878 }
79- if ! strings .Contains (podsExecNilNamespace .Content [0 ].(mcp.TextContent ).Text , "command:ls -l\n " ) {
79+ if ! strings .Contains (podsExecInNamespace .Content [0 ].(mcp.TextContent ).Text , "command:ls -l\n " ) {
8080 t .Errorf ("unexpected result %v" , podsExecInNamespace .Content [0 ].(mcp.TextContent ).Text )
8181 }
8282 })
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ func TestPodsListInAllNamespacesUnauthorized(t *testing.T) {
9494 return
9595 }
9696 if toolResult .IsError {
97- t .Fatalf ("call tool failed" )
97+ t .Fatalf ("call tool failed %v" , toolResult . Content )
9898 return
9999 }
100100 })
Original file line number Diff line number Diff line change 11package mcp
22
33import (
4- "github.com/mark3labs/mcp-go/mcp"
54 "slices"
65 "strings"
76 "testing"
7+
8+ "github.com/mark3labs/mcp-go/mcp"
89)
910
1011func TestFullProfileTools (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments