update missing provider transform test
The CloserProviderTransformer requires that the resources be connected to their provider first, so that it cen get the correct dependencies, and adding the ProviderTransformer changed the test output slightly.
This commit is contained in:
parent
8388dfd2f9
commit
12a4a29cbd
|
@ -121,7 +121,7 @@ func (t *CloseProviderTransformer) Transform(g *Graph) error {
|
|||
|
||||
// connect all the provider's resources to the close node
|
||||
for _, s := range g.UpEdges(p).List() {
|
||||
if _, ok := s.(GraphNodeResource); ok {
|
||||
if _, ok := s.(GraphNodeProviderConsumer); ok {
|
||||
g.Connect(dag.BasicEdge(closer, s))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,6 +178,13 @@ func TestMissingProviderTransformer(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
transform := &ProviderTransformer{}
|
||||
if err := transform.Transform(&g); err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
transform := &CloseProviderTransformer{}
|
||||
if err := transform.Transform(&g); err != nil {
|
||||
|
@ -188,7 +195,7 @@ func TestMissingProviderTransformer(t *testing.T) {
|
|||
actual := strings.TrimSpace(g.String())
|
||||
expected := strings.TrimSpace(testTransformMissingProviderBasicStr)
|
||||
if actual != expected {
|
||||
t.Fatalf("bad:\n\n%s", actual)
|
||||
t.Fatalf("expected:\n%s\n\ngot:\n%s", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -413,7 +420,9 @@ provider.aws (close)
|
|||
|
||||
const testTransformMissingProviderBasicStr = `
|
||||
aws_instance.web
|
||||
provider.aws
|
||||
foo_instance.web
|
||||
provider.foo
|
||||
provider.aws
|
||||
provider.aws (close)
|
||||
aws_instance.web
|
||||
|
|
Loading…
Reference in New Issue