MCPcopy
hub / github.com/redspread/spread / TestRCValidPodDeployment

Function TestRCValidPodDeployment

pkg/entity/replicationcontroller_test.go:75–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestRCValidPodDeployment(t *testing.T) {
76 selector := map[string]string{
77 "service": "postgres",
78 }
79 kubePod := testCreateKubePodSourcegraph("sourcegraph")
80 kubePod.Labels = selector
81 kubeRC := testNewKubeRC(kube.ObjectMeta{Name: "sourcegraph-rc", Namespace: kube.NamespaceDefault}, selector, kubePod)
82
83 rc, err := NewReplicationController(kubeRC, kube.ObjectMeta{}, "")
84 assert.NoError(t, err)
85 assert.NotNil(t, rc.pod, "a pod should have be created")
86 assert.Len(t, rc.pod.containers, 2, "two containers should have been created")
87
88 expected := new(deploy.Deployment)
89 err = expected.Add(kubeRC)
90 assert.NoError(t, err, "should be valid RC")
91
92 actual, err := rc.Deployment()
93 assert.NoError(t, err)
94 testDeploymentEqual(t, expected, actual)
95}
96
97func TestRCBadObjects(t *testing.T) {
98 objects := []deploy.KubeObject{

Callers

nothing calls this directly

Calls 7

DeploymentMethod · 0.95
testNewKubeRCFunction · 0.85
NewReplicationControllerFunction · 0.85
testDeploymentEqualFunction · 0.85
LenMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected