fix show -json tests

The prior state recorded in the plans did not match the actual prior
state. Make the plans and state match depending on whether there was
existing state or not.
This commit is contained in:
James Bardin 2020-09-11 15:53:21 -04:00
parent ad5899d8bb
commit e54949f2e1
5 changed files with 15 additions and 33 deletions

View File

@ -53,18 +53,7 @@
]
}
},
"prior_state": {
"format_version": "0.1",
"values": {
"outputs": {
"test": {
"sensitive": false,
"value": "bar"
}
},
"root_module": {}
}
},
"prior_state": {},
"resource_changes": [
{
"address": "test_instance.test[0]",

View File

@ -3,7 +3,12 @@
"terraform_version": "0.12.0",
"serial": 7,
"lineage": "configuredUnchanged",
"outputs": {},
"outputs": {
"test": {
"value": "bar",
"type": "string"
}
},
"resources": [
{
"mode": "managed",

View File

@ -3,7 +3,12 @@
"terraform_version": "0.12.0",
"serial": 7,
"lineage": "configuredUnchanged",
"outputs": {},
"outputs": {
"test": {
"value": "bar",
"type": "string"
}
},
"resources": [
{
"mode": "managed",

View File

@ -69,18 +69,7 @@
]
}
},
"prior_state": {
"format_version": "0.1",
"values": {
"outputs": {
"test": {
"sensitive": false,
"value": "baz"
}
},
"root_module": {}
}
},
"prior_state": {},
"resource_changes": [
{
"address": "module.module_test_bar.test_instance.test",

View File

@ -101,20 +101,14 @@
"format_version": "0.1",
"terraform_version": "0.13.0",
"values": {
"outputs": {
"test": {
"sensitive": false,
"value": "bar"
}
},
"root_module": {
"resources": [
{
"address": "test_instance.test[0]",
"index": 0,
"mode": "managed",
"type": "test_instance",
"name": "test",
"index": 0,
"provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0,
"values": {