add failing test for IgnoreAllChanges override

This commit is contained in:
Katy Moe 2021-11-01 19:00:54 +00:00
parent 079aabb70e
commit df6dad5070
No known key found for this signature in database
GPG Key ID: 8C3780F6DCDDA885
3 changed files with 19 additions and 0 deletions

View File

@ -320,3 +320,13 @@ func TestModuleOverrideResourceFQNs(t *testing.T) {
t.Fatalf("wrong result: found provider config ref %s, expected nil", got.ProviderConfigRef)
}
}
func TestModuleOverrideIgnoreAllChanges(t *testing.T) {
mod, diags := testModuleFromDir("testdata/valid-modules/override-ignore-changes")
assertNoDiagnostics(t, diags)
r := mod.ManagedResources["test_instance.foo"]
if !r.Managed.IgnoreAllChanges {
t.Fatalf("wrong result: expected r.Managed.IgnoreAllChanges to be true")
}
}

View File

@ -0,0 +1,3 @@
resource "test_instance" "foo" {
foo = "bar"
}

View File

@ -0,0 +1,6 @@
resource "test_instance" "foo" {
foo = "bar"
lifecycle {
ignore_changes = all
}
}