MCPcopy
hub / github.com/helm/helm / TestStatusWaitMultipleNamespaces

Function TestStatusWaitMultipleNamespaces

pkg/kube/statuswait_test.go:573–689  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

571}
572
573func TestStatusWaitMultipleNamespaces(t *testing.T) {
574 t.Parallel()
575 tests := []struct {
576 name string
577 objManifests []string
578 expectErrStrs []string
579 testFunc func(*statusWaiter, ResourceList, time.Duration) error
580 }{
581 {
582 name: "pods in multiple namespaces",
583 objManifests: []string{podNamespace1Manifest, podNamespace2Manifest},
584 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
585 return sw.Wait(rl, timeout)
586 },
587 },
588 {
589 name: "hooks in multiple namespaces",
590 objManifests: []string{jobNamespace1CompleteManifest, podNamespace2SucceededManifest},
591 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
592 return sw.WatchUntilReady(rl, timeout)
593 },
594 },
595 {
596 name: "error when resource not ready in one namespace",
597 objManifests: []string{podNamespace1NoStatusManifest, podNamespace2Manifest},
598 expectErrStrs: []string{"resource Pod/namespace-1/pod-ns1 not ready. status: InProgress", "context deadline exceeded"},
599 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
600 return sw.Wait(rl, timeout)
601 },
602 },
603 {
604 name: "delete resources in multiple namespaces",
605 objManifests: []string{podNamespace1Manifest, podNamespace2Manifest},
606 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
607 return sw.WaitForDelete(rl, timeout)
608 },
609 },
610 {
611 name: "cluster-scoped resources work correctly with unrestricted permissions",
612 objManifests: []string{podNamespace1Manifest, clusterRoleManifest},
613 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
614 return sw.Wait(rl, timeout)
615 },
616 },
617 {
618 name: "namespace-scoped and cluster-scoped resources work together",
619 objManifests: []string{podNamespace1Manifest, podNamespace2Manifest, clusterRoleManifest},
620 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
621 return sw.Wait(rl, timeout)
622 },
623 },
624 {
625 name: "delete cluster-scoped resources works correctly",
626 objManifests: []string{podNamespace1Manifest, namespaceManifest},
627 testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error {
628 return sw.WaitForDelete(rl, timeout)
629 },
630 },

Callers

nothing calls this directly

Calls 13

WaitMethod · 0.95
WatchUntilReadyMethod · 0.95
WaitForDeleteMethod · 0.95
newTestClientFunction · 0.85
getGVRFunction · 0.85
ContainsMethod · 0.80
RunMethod · 0.65
SetLoggerMethod · 0.65
CreateMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…