Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkg/mcp/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package mcp
import (
"context"
"encoding/base64"
"path/filepath"
"runtime"
"strings"
"testing"

"github.com/containers/kubernetes-mcp-server/pkg/config"
"github.com/mark3labs/mcp-go/mcp"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"path/filepath"
"runtime"
"sigs.k8s.io/yaml"
"strings"
"testing"
)

func TestHelmInstall(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions pkg/mcp/mcp_tools_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package mcp

import (
"github.com/mark3labs/mcp-go/client/transport"
"github.com/mark3labs/mcp-go/mcp"
"k8s.io/utils/ptr"
"regexp"
"strings"
"testing"

"github.com/mark3labs/mcp-go/client/transport"
"github.com/mark3labs/mcp-go/mcp"
"k8s.io/utils/ptr"

"github.com/containers/kubernetes-mcp-server/pkg/config"
)

Expand Down
7 changes: 4 additions & 3 deletions pkg/mcp/namespaces_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package mcp

import (
"regexp"
"slices"
"testing"

"github.com/containers/kubernetes-mcp-server/pkg/config"
"github.com/containers/kubernetes-mcp-server/pkg/output"
"github.com/mark3labs/mcp-go/mcp"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"regexp"
"sigs.k8s.io/yaml"
"slices"
"testing"
)

func TestNamespacesList(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/mcp/pods_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestPodsExec(t *testing.T) {
t.Fatalf("call tool failed %v", err)
}
if podsExecNilNamespace.IsError {
t.Fatalf("call tool failed")
t.Fatalf("call tool failed: %v", podsExecNilNamespace.Content)
}
if !strings.Contains(podsExecNilNamespace.Content[0].(mcp.TextContent).Text, "command:ls -l\n") {
t.Errorf("unexpected result %v", podsExecNilNamespace.Content[0].(mcp.TextContent).Text)
Expand All @@ -74,9 +74,9 @@ func TestPodsExec(t *testing.T) {
t.Fatalf("call tool failed %v", err)
}
if podsExecInNamespace.IsError {
t.Fatalf("call tool failed")
t.Fatalf("call tool failed: %v", podsExecInNamespace.Content)
}
if !strings.Contains(podsExecNilNamespace.Content[0].(mcp.TextContent).Text, "command:ls -l\n") {
if !strings.Contains(podsExecInNamespace.Content[0].(mcp.TextContent).Text, "command:ls -l\n") {
t.Errorf("unexpected result %v", podsExecInNamespace.Content[0].(mcp.TextContent).Text)
}
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcp/pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestPodsListInAllNamespacesUnauthorized(t *testing.T) {
return
}
if toolResult.IsError {
t.Fatalf("call tool failed")
t.Fatalf("call tool failed %v", toolResult.Content)
return
}
})
Expand Down
3 changes: 2 additions & 1 deletion pkg/mcp/profiles_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package mcp

import (
"github.com/mark3labs/mcp-go/mcp"
"slices"
"strings"
"testing"

"github.com/mark3labs/mcp-go/mcp"
)

func TestFullProfileTools(t *testing.T) {
Expand Down
Loading