command: Fix various TestMetaBackend-prefix tests

Our new state model has a different implementation of "empty" that doesn't
consider lineage/serial, so we need to have some actual content in these
state fixtures to avoid them being skipped during state migrations.
This commit is contained in:
Martin Atkins 2018-11-13 17:39:06 -08:00
parent 22c84c71a4
commit f39a5d0962
13 changed files with 153 additions and 16 deletions

View File

@ -502,8 +502,8 @@ func TestMetaBackend_configureNewWithStateExisting(t *testing.T) {
if state == nil {
t.Fatal("state is nil")
}
if testStateMgrCurrentLineage(s) != "local" {
t.Fatalf("bad: %#v", state)
if got, want := testStateMgrCurrentLineage(s), "local"; got != want {
t.Fatalf("wrong lineage %q; want %q", got, want)
}
// Write some state
@ -1414,8 +1414,8 @@ func TestMetaBackend_configuredUnsetCopy(t *testing.T) {
if state == nil {
t.Fatal("state is nil")
}
if testStateMgrCurrentLineage(s) != "configuredUnset" {
t.Fatalf("bad: %#v", state)
if got, want := testStateMgrCurrentLineage(s), "configuredUnset"; got != want {
t.Fatalf("wrong state lineage %q; want %q", got, want)
}
// Verify a backup doesn't exist

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change"
"lineage": "backend-change",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change"
"lineage": "backend-change",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change-env2"
"lineage": "backend-change-env2",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change-env1"
"lineage": "backend-change-env1",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change-env2"
"lineage": "backend-change-env2",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change-env2"
"lineage": "backend-change-env2",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change"
"lineage": "backend-change",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change-env2"
"lineage": "backend-change-env2",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change"
"lineage": "backend-change",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "backend-change"
"lineage": "backend-change",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}

View File

@ -8,7 +8,12 @@
"path": [
"root"
],
"outputs": {},
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {},
"depends_on": []
}

View File

@ -2,5 +2,17 @@
"version": 3,
"terraform_version": "0.8.2",
"serial": 7,
"lineage": "configuredUnset"
"lineage": "configuredUnset",
"modules": [
{
"path": ["root"],
"outputs": {
"foo": {
"type": "string",
"value": "bar"
}
},
"resources": {}
}
]
}