core: Remove TestContext2Validate_PlanGraphBuilder
This test seems to be a holdover from the many-moons-ago switch from one graph for all operations to separate graphs for plan and apply. It is effectively just a copy of a subset of the content of the Context.Validate function and is a maintainability hazard because it tends to lag behind updates to that function unless changes there happen to make it fail. This test doesn't cover anything that the other validate context tests don't exercise as an implementation detail of calling Context.Validate, so I've just removed it with no replacement.
This commit is contained in:
parent
a579ae15b0
commit
483c38aca1
|
@ -1187,32 +1187,6 @@ resource "aws_instance" "foo" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manually validate using the new PlanGraphBuilder
|
|
||||||
func TestContext2Validate_PlanGraphBuilder(t *testing.T) {
|
|
||||||
fixture := contextFixtureApplyVars(t)
|
|
||||||
opts := fixture.ContextOpts()
|
|
||||||
c := testContext2(t, opts)
|
|
||||||
|
|
||||||
graph, diags := ValidateGraphBuilder(&PlanGraphBuilder{
|
|
||||||
Config: fixture.Config,
|
|
||||||
State: states.NewState(),
|
|
||||||
Plugins: c.plugins,
|
|
||||||
}).Build(addrs.RootModuleInstance)
|
|
||||||
if diags.HasErrors() {
|
|
||||||
t.Fatalf("errors from PlanGraphBuilder: %s", diags.Err())
|
|
||||||
}
|
|
||||||
defer c.acquireRun("validate-test")()
|
|
||||||
walker, diags := c.walk(graph, walkValidate, &graphWalkOpts{
|
|
||||||
Config: fixture.Config,
|
|
||||||
})
|
|
||||||
if diags.HasErrors() {
|
|
||||||
t.Fatal(diags.Err())
|
|
||||||
}
|
|
||||||
if len(walker.NonFatalDiagnostics) > 0 {
|
|
||||||
t.Fatal(walker.NonFatalDiagnostics.Err())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestContext2Validate_invalidOutput(t *testing.T) {
|
func TestContext2Validate_invalidOutput(t *testing.T) {
|
||||||
m := testModuleInline(t, map[string]string{
|
m := testModuleInline(t, map[string]string{
|
||||||
"main.tf": `
|
"main.tf": `
|
||||||
|
|
Loading…
Reference in New Issue