(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestDeploy(t *testing.T) { |
| 116 | testCases := []deployTestCase{ |
| 117 | { |
| 118 | name: "Skip deployment", |
| 119 | deploymentConfigs: map[string]*latest.DeploymentConfig{ |
| 120 | "skippedDeployment": { |
| 121 | Name: "skippedDeployment", |
| 122 | }, |
| 123 | }, |
| 124 | options: &Options{ |
| 125 | SkipDeploy: true, |
| 126 | Render: true, |
| 127 | }, |
| 128 | deploymentNames: []string{"unskippedDeployment"}, |
| 129 | }, |
| 130 | { |
| 131 | name: "No deployment method", |
| 132 | deploymentConfigs: map[string]*latest.DeploymentConfig{ |
| 133 | "noMethod": { |
| 134 | Name: "noMethod", |
| 135 | }, |
| 136 | }, |
| 137 | deploymentNames: []string{"noMethod"}, |
| 138 | options: &Options{ |
| 139 | Render: true, |
| 140 | }, |
| 141 | expectedErr: "error deploying: deployment noMethod has no deployment method", |
| 142 | }, |
| 143 | { |
| 144 | name: "Deploy with kubectl", |
| 145 | deploymentConfigs: map[string]*latest.DeploymentConfig{ |
| 146 | "kubectlDeploy": { |
| 147 | Name: "kubectlDeploy", |
| 148 | Kubectl: &latest.KubectlConfig{ |
| 149 | Manifests: []string{}, |
| 150 | }, |
| 151 | }, |
| 152 | }, |
| 153 | options: &Options{ |
| 154 | Render: true, |
| 155 | }, |
| 156 | deploymentNames: []string{"kubectlDeploy"}, |
| 157 | }, |
| 158 | { |
| 159 | name: "Deploy concurrently", |
| 160 | deploymentConfigs: map[string]*latest.DeploymentConfig{ |
| 161 | "concurrentDeploy1": { |
| 162 | Name: "concurrentDeploy1", |
| 163 | Kubectl: &latest.KubectlConfig{ |
| 164 | Manifests: []string{}, |
| 165 | }, |
| 166 | }, |
| 167 | "concurrentDeploy2": { |
| 168 | Name: "concurrentDeploy2", |
| 169 | Kubectl: &latest.KubectlConfig{ |
| 170 | Manifests: []string{}, |
| 171 | }, |
| 172 | }, |
nothing calls this directly
no test coverage detected