core: Clean up test for issue #5254
This commit is contained in:
parent
2c48a7c4cb
commit
5d9637ab1a
|
@ -3944,7 +3944,6 @@ func TestContext2Apply_issue5254(t *testing.T) {
|
||||||
p.DiffFn = testDiffFn
|
p.DiffFn = testDiffFn
|
||||||
|
|
||||||
// Apply cleanly step 0
|
// Apply cleanly step 0
|
||||||
t.Log("Applying Step 0")
|
|
||||||
ctx := testContext2(t, &ContextOpts{
|
ctx := testContext2(t, &ContextOpts{
|
||||||
Module: testModule(t, "issue-5254/step-0"),
|
Module: testModule(t, "issue-5254/step-0"),
|
||||||
Providers: map[string]ResourceProviderFactory{
|
Providers: map[string]ResourceProviderFactory{
|
||||||
|
@ -3956,7 +3955,6 @@ func TestContext2Apply_issue5254(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
t.Logf("Plan for Step 0: %s", plan)
|
|
||||||
|
|
||||||
state, err := ctx.Apply()
|
state, err := ctx.Apply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -3964,8 +3962,6 @@ func TestContext2Apply_issue5254(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Application success. Now make the modification and store a plan
|
// Application success. Now make the modification and store a plan
|
||||||
println("Planning Step 1")
|
|
||||||
t.Log("Planning Step 1")
|
|
||||||
ctx = testContext2(t, &ContextOpts{
|
ctx = testContext2(t, &ContextOpts{
|
||||||
Module: testModule(t, "issue-5254/step-1"),
|
Module: testModule(t, "issue-5254/step-1"),
|
||||||
State: state,
|
State: state,
|
||||||
|
@ -3990,11 +3986,6 @@ func TestContext2Apply_issue5254(t *testing.T) {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Logf("Plan for Step 1: %s", planFromFile)
|
|
||||||
|
|
||||||
// Apply the plan
|
|
||||||
println("Applying Step 1 (from Plan)")
|
|
||||||
t.Log("Applying Step 1 (from plan)")
|
|
||||||
ctx = planFromFile.Context(&ContextOpts{
|
ctx = planFromFile.Context(&ContextOpts{
|
||||||
Providers: map[string]ResourceProviderFactory{
|
Providers: map[string]ResourceProviderFactory{
|
||||||
"template": testProviderFuncFixed(p),
|
"template": testProviderFuncFixed(p),
|
||||||
|
@ -4006,11 +3997,21 @@ func TestContext2Apply_issue5254(t *testing.T) {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
actual := strings.TrimSpace(state.String())
|
actual := strings.TrimSpace(state.String())
|
||||||
expected := strings.TrimSpace(testTerraformApplyProviderAliasStr)
|
expected := strings.TrimSpace(`
|
||||||
|
template_file.child:
|
||||||
|
ID = foo
|
||||||
|
template = Hi
|
||||||
|
type = template_file
|
||||||
|
|
||||||
|
Dependencies:
|
||||||
|
template_file.parent
|
||||||
|
template_file.parent:
|
||||||
|
ID = foo
|
||||||
|
template = Hi
|
||||||
|
type = template_file
|
||||||
|
`)
|
||||||
if actual != expected {
|
if actual != expected {
|
||||||
t.Fatalf("bad: \n%s", actual)
|
t.Fatalf("expected state: \n%s\ngot: \n%s", expected, actual)
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue