(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func 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 | |
| 97 | func TestRCBadObjects(t *testing.T) { |
| 98 | objects := []deploy.KubeObject{ |
nothing calls this directly
no test coverage detected