Skip to content

Instantly share code, notes, and snippets.

@vancluever
Last active October 2, 2016 20:51
Show Gist options
  • Select an option

  • Save vancluever/b0c52e5da0193d6a24b0a326d7117c6c to your computer and use it in GitHub Desktop.

Select an option

Save vancluever/b0c52e5da0193d6a24b0a326d7117c6c to your computer and use it in GitHub Desktop.
Terraform - schema_test.go - failing test for TestSchemaMap_Diff
"Complex structure with list of computed string should mark root set as computed": {
Schema: map[string]*Schema{
"outer": &Schema{
Type: TypeSet,
Optional: true,
Elem: &Resource{
Schema: map[string]*Schema{
"outer_str": &Schema{
Type: TypeString,
Optional: true,
},
"inner": &Schema{
Type: TypeList,
Optional: true,
Elem: &Schema{Type: TypeString},
},
},
},
Set: func(v interface{}) int {
return 1
},
},
},
State: nil,
Config: map[string]interface{}{
"outer": []map[string]interface{}{
map[string]interface{}{
"outer_str": "foo",
"inner": []interface{}{"${var.bar}"},
},
},
},
ConfigVariables: map[string]ast.Variable{
"var.bar": interfaceToVariableSwallowError(config.UnknownVariableValue),
},
Diff: &terraform.InstanceDiff{
Attributes: map[string]*terraform.ResourceAttrDiff{
"outer.#": &terraform.ResourceAttrDiff{
Old: "0",
New: "1",
},
"outer.~1.outer_str": &terraform.ResourceAttrDiff{
Old: "",
New: "foo",
},
"outer.~1.inner.#": &terraform.ResourceAttrDiff{
Old: "0",
New: "1",
},
"outer.~1.inner.0": &terraform.ResourceAttrDiff{
Old: "",
New: "${var.bar}",
},
},
},
Err: false,
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment