Skip to content

Commit d311e7e

Browse files
move test case to more appropriate PR
#38006 is dealing with resource deprecation
1 parent 1c5ec29 commit d311e7e

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

internal/terraform/context_validate_test.go

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4412,64 +4412,6 @@ module "sink" {
44124412
}))
44134413
}
44144414

4415-
// TODO: Shouldn't this one live in https://github.com/hashicorp/terraform/pull/38006
4416-
func TestContext2Validate_deprecated_resource(t *testing.T) {
4417-
m := testModuleInline(t, map[string]string{
4418-
"main.tf": `
4419-
resource "test_resource" "test" { # WARNING
4420-
attr = "value"
4421-
}
4422-
4423-
output "a" {
4424-
value = test_resource.test.attr # WARNING
4425-
}
4426-
`,
4427-
})
4428-
4429-
p := new(testing_provider.MockProvider)
4430-
p.GetProviderSchemaResponse = getProviderSchemaResponseFromProviderSchema(&providerSchema{
4431-
ResourceTypes: map[string]*configschema.Block{
4432-
"test_resource": {
4433-
Deprecated: true,
4434-
Attributes: map[string]*configschema.Attribute{
4435-
"attr": {
4436-
Type: cty.String,
4437-
Computed: true,
4438-
},
4439-
},
4440-
},
4441-
},
4442-
})
4443-
4444-
ctx := testContext2(t, &ContextOpts{
4445-
Providers: map[addrs.Provider]providers.Factory{
4446-
addrs.NewDefaultProvider("test"): testProviderFuncFixed(p),
4447-
},
4448-
})
4449-
4450-
diags := ctx.Validate(m, &ValidateOpts{})
4451-
4452-
tfdiags.AssertDiagnosticsMatch(t, diags, tfdiags.Diagnostics{}.Append(&hcl.Diagnostic{
4453-
Severity: hcl.DiagWarning,
4454-
Summary: `Usage of deprecated resource "test_resource"`,
4455-
Detail: `The resource "test_resource" has been marked as deprecated by its provider. Please check the provider documentation for more information.`,
4456-
Subject: &hcl.Range{
4457-
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
4458-
Start: hcl.Pos{Line: 2, Column: 1, Byte: 1},
4459-
End: hcl.Pos{Line: 2, Column: 32, Byte: 32},
4460-
},
4461-
}).Append(&hcl.Diagnostic{
4462-
Severity: hcl.DiagWarning,
4463-
Summary: "Deprecated value used",
4464-
Detail: `Resource "test_resource" is deprecated`,
4465-
Subject: &hcl.Range{
4466-
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
4467-
Start: hcl.Pos{Line: 7, Column: 13, Byte: 92},
4468-
End: hcl.Pos{Line: 7, Column: 36, Byte: 115},
4469-
},
4470-
}))
4471-
}
4472-
44734415
func TestContext2Validate_deprecated_root_output(t *testing.T) {
44744416
m := testModuleInline(t, map[string]string{
44754417
"mod/main.tf": `

0 commit comments

Comments
 (0)