Skip to content
Closed
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
24 changes: 24 additions & 0 deletions internal/e2e/suites/demo/demo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/agent-substrate/substrate/pkg/api/v1alpha1"
"github.com/agent-substrate/substrate/pkg/proto/ateapipb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
Expand Down Expand Up @@ -359,6 +360,18 @@ func TestExternalVolumeLifecycle(t *testing.T) {
t.Skip("Skipping TestExternalVolumeLifecycle for microVM environment")
}

ctx := context.Background()
clients := e2e.GetClients()

nodes, err := clients.K8s.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
if err != nil {
t.Fatalf("failed to list nodes: %v", err)
}

if !isKindCluster(nodes.Items) && len(nodes.Items) > 1 {
t.Skipf("Skipping TestExternalVolumeLifecycle: external volumes with mock driver are not supported in multi-node non-kind environments (node count: %d)", len(nodes.Items))
}

tests := []struct {
name string
tc actorLifecycleTestCase
Expand Down Expand Up @@ -1136,6 +1149,17 @@ func isMicroVMEnvironment() bool {
return os.Getenv("E2E_TEMPLATE_NAMESPACE") == "ate-demo-counter-microvm"
}

// isKindCluster reports whether the cluster is running on Kind by inspecting
// the providerID of the nodes.
func isKindCluster(nodes []corev1.Node) bool {
for _, node := range nodes {
if strings.HasPrefix(node.Spec.ProviderID, "kind://") {
return true
}
}
return false
}

func TestWorkerPodDeletion(t *testing.T) {
// Create namespace
nsObj := e2e.CreateNamespace(t)
Expand Down
Loading