core: fix TestContext2Apply_resourceDependsOnModuleInModule

An earlier update to make this not use info.HumanId selected the wrong
fake "ami" name in the branch here.

Also, the error message for this failure was terrible. :(
This commit is contained in:
Martin Atkins 2018-09-12 14:59:27 -07:00
parent d104e450d8
commit b648e3fc84
3 changed files with 6 additions and 3 deletions

View File

@ -524,7 +524,7 @@ func TestContext2Apply_resourceDependsOnModuleInModule(t *testing.T) {
var called int32
var checked bool
p.ApplyFn = func(info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) {
if id.Attributes["ami"].New == "child" {
if id.Attributes["ami"].New == "grandchild" {
checked = true
// Sleep to allow parallel execution
@ -532,7 +532,7 @@ func TestContext2Apply_resourceDependsOnModuleInModule(t *testing.T) {
// Verify that called is 0 (dep not called)
if atomic.LoadInt32(&called) != 0 {
return nil, fmt.Errorf("nothing else should not be called")
return nil, fmt.Errorf("something else was applied before grandchild; grandchild should be first")
}
}

View File

@ -831,6 +831,8 @@ module.child:
aws_instance.b:
ID = foo
provider = provider.aws
ami = child
type = aws_instance
Dependencies:
module.grandchild
@ -838,6 +840,8 @@ module.child.grandchild:
aws_instance.c:
ID = foo
provider = provider.aws
ami = grandchild
type = aws_instance
`
const testTerraformApplyTaintStr = `

View File

@ -1,4 +1,3 @@
resource "aws_instance" "c" {
ami = "grandchild"
}