command: Stub the "terraform state mv" tests to remind to fix

This command isn't yet updated for the new state types, but since we were
not returning a non-successful error status here the tests were just
failing in a weird way instead. Now we'll fail with a message that makes
it clear there is still work to do in the real implementation here.
This commit is contained in:
Martin Atkins 2018-10-13 09:41:44 -07:00
parent 1d64ce8ec0
commit 43d5206d82
2 changed files with 45 additions and 0 deletions

View File

@ -80,6 +80,7 @@ func (c *StateMvCommand) Run(args []string) int {
} }
c.Ui.Error("state mv command not yet updated for new state types") c.Ui.Error("state mv command not yet updated for new state types")
return 1
/* /*
// Filter what we're moving // Filter what we're moving
filter := &terraform.StateFilter{State: stateFromReal} filter := &terraform.StateFilter{State: stateFromReal}

View File

@ -720,10 +720,12 @@ func TestStateMv_fromBackendToLocal(t *testing.T) {
const testStateMvOutputOriginal = ` const testStateMvOutputOriginal = `
test_instance.baz: test_instance.baz:
ID = foo ID = foo
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -731,10 +733,12 @@ test_instance.foo:
const testStateMvOutput = ` const testStateMvOutput = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.baz: test_instance.baz:
ID = foo ID = foo
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -742,10 +746,12 @@ test_instance.baz:
const testStateMvCount_stateOut = ` const testStateMvCount_stateOut = `
test_instance.bar.0: test_instance.bar.0:
ID = foo ID = foo
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.1: test_instance.bar.1:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -753,6 +759,7 @@ test_instance.bar.1:
const testStateMvCount_stateOutSrc = ` const testStateMvCount_stateOutSrc = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -760,14 +767,17 @@ test_instance.bar:
const testStateMvCount_stateOutOriginal = ` const testStateMvCount_stateOutOriginal = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.0: test_instance.foo.0:
ID = foo ID = foo
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.1: test_instance.foo.1:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -775,46 +785,57 @@ test_instance.foo.1:
const testStateMvLargeCount_stateOut = ` const testStateMvLargeCount_stateOut = `
test_instance.bar.0: test_instance.bar.0:
ID = foo0 ID = foo0
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.1: test_instance.bar.1:
ID = foo1 ID = foo1
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.2: test_instance.bar.2:
ID = foo2 ID = foo2
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.3: test_instance.bar.3:
ID = foo3 ID = foo3
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.4: test_instance.bar.4:
ID = foo4 ID = foo4
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.5: test_instance.bar.5:
ID = foo5 ID = foo5
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.6: test_instance.bar.6:
ID = foo6 ID = foo6
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.7: test_instance.bar.7:
ID = foo7 ID = foo7
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.8: test_instance.bar.8:
ID = foo8 ID = foo8
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.9: test_instance.bar.9:
ID = foo9 ID = foo9
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.bar.10: test_instance.bar.10:
ID = foo10 ID = foo10
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -822,6 +843,7 @@ test_instance.bar.10:
const testStateMvLargeCount_stateOutSrc = ` const testStateMvLargeCount_stateOutSrc = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -829,50 +851,62 @@ test_instance.bar:
const testStateMvLargeCount_stateOutOriginal = ` const testStateMvLargeCount_stateOutOriginal = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.0: test_instance.foo.0:
ID = foo0 ID = foo0
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.1: test_instance.foo.1:
ID = foo1 ID = foo1
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.2: test_instance.foo.2:
ID = foo2 ID = foo2
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.3: test_instance.foo.3:
ID = foo3 ID = foo3
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.4: test_instance.foo.4:
ID = foo4 ID = foo4
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.5: test_instance.foo.5:
ID = foo5 ID = foo5
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.6: test_instance.foo.6:
ID = foo6 ID = foo6
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.7: test_instance.foo.7:
ID = foo7 ID = foo7
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.8: test_instance.foo.8:
ID = foo8 ID = foo8
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.9: test_instance.foo.9:
ID = foo9 ID = foo9
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.foo.10: test_instance.foo.10:
ID = foo10 ID = foo10
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -884,11 +918,13 @@ module.bar:
module.bar.child1: module.bar.child1:
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
module.bar.child2: module.bar.child2:
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -904,11 +940,13 @@ module.foo:
module.foo.child1: module.foo.child1:
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
module.foo.child2: module.foo.child2:
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -916,6 +954,7 @@ module.foo.child2:
const testStateMvOutput_stateOut = ` const testStateMvOutput_stateOut = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -927,6 +966,7 @@ const testStateMvOutput_stateOutSrc = `
const testStateMvOutput_stateOutOriginal = ` const testStateMvOutput_stateOutOriginal = `
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -938,6 +978,7 @@ const testStateMvExisting_stateSrc = `
const testStateMvExisting_stateDst = ` const testStateMvExisting_stateDst = `
test_instance.bar: test_instance.bar:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
test_instance.qux: test_instance.qux:
@ -947,6 +988,7 @@ test_instance.qux:
const testStateMvExisting_stateSrcOriginal = ` const testStateMvExisting_stateSrcOriginal = `
test_instance.foo: test_instance.foo:
ID = bar ID = bar
provider = provider.test
bar = value bar = value
foo = value foo = value
` `
@ -954,11 +996,13 @@ test_instance.foo:
const testStateMvExisting_stateDstOriginal = ` const testStateMvExisting_stateDstOriginal = `
test_instance.qux: test_instance.qux:
ID = bar ID = bar
provider = provider.test
` `
const testStateMvOriginal_backend = ` const testStateMvOriginal_backend = `
test_instance.baz: test_instance.baz:
ID = foo ID = foo
provider = provider.test
bar = value bar = value
foo = value foo = value
` `