(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func TestSetFlag(t *testing.T) { |
| 29 | s := "deployments.dev.helm.values.containers[1].image=" |
| 30 | rawConfig := getActualRawConfig() |
| 31 | err := ParseInto(s, rawConfig) |
| 32 | if err != nil { |
| 33 | fmt.Println(errors.Wrap(err, "parsing --set flag")) |
| 34 | log.Fatal(err) |
| 35 | } |
| 36 | b, err := json.Marshal(rawConfig) |
| 37 | if err != nil { |
| 38 | fmt.Println(err) |
| 39 | } |
| 40 | fmt.Println("output : " + string(b)) |
| 41 | assert.DeepEqual(t, rawConfig, getExpectedRawConfigForSet()) |
| 42 | } |
| 43 | |
| 44 | func getExpectedRawConfigForSet() map[string]interface{} { |
| 45 | jsonStr := "{\"deployments\":{\"dev\":{\"helm\":{\"values\":{\"containers\":[{\"image\":\"alpine\"},{\"image\":null}]}}}},\"name\":\"run-pipelines-demo\",\"pipelines\":{\"deploy\":\"create_deployments --all\",\"dev\":\"run_pipelines deploy --set deployments.dev.helm.values.containers[0].image=nginx --set-string deployments.dev.helm.values.containers[0].name=mynginx\"},\"version\":\"v2beta1\"}" |
nothing calls this directly
no test coverage detected