"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/terraform/context_apply2_test.go" between
terraform-1.0.8.tar.gz and terraform-1.0.9.tar.gz

About: Terraform is a tool for building, changing, and versioning a datacenter infrastructure (written in Go).

context_apply2_test.go  (terraform-1.0.8):context_apply2_test.go  (terraform-1.0.9)
skipping to change at line 576 skipping to change at line 576
// make sure the same marks are compared in the next plan as well // make sure the same marks are compared in the next plan as well
for _, c := range plan.Changes.Resources { for _, c := range plan.Changes.Resources {
if c.Action != plans.NoOp { if c.Action != plans.NoOp {
t.Logf("marks before: %#v", c.BeforeValMarks) t.Logf("marks before: %#v", c.BeforeValMarks)
t.Logf("marks after: %#v", c.AfterValMarks) t.Logf("marks after: %#v", c.AfterValMarks)
t.Errorf("Unexpcetd %s change for %s", c.Action, c.Addr) t.Errorf("Unexpcetd %s change for %s", c.Action, c.Addr)
} }
} }
} }
func TestContext2Apply_destroyWithDeposed(t *testing.T) {
m := testModuleInline(t, map[string]string{
"main.tf": `
resource "test_object" "x" {
test_string = "ok"
lifecycle {
create_before_destroy = true
}
}`,
})
p := simpleMockProvider()
deposedKey := states.NewDeposedKey()
state := states.NewState()
root := state.EnsureModule(addrs.RootModuleInstance)
root.SetResourceInstanceDeposed(
mustResourceInstanceAddr("test_object.x").Resource,
deposedKey,
&states.ResourceInstanceObjectSrc{
Status: states.ObjectTainted,
AttrsJSON: []byte(`{"test_string":"deposed"}`),
},
mustProviderConfig(`provider["registry.terraform.io/hashicorp/tes
t"]`),
)
ctx := testContext2(t, &ContextOpts{
Providers: map[addrs.Provider]providers.Factory{
addrs.NewDefaultProvider("test"): testProviderFuncFixed(p
),
},
State: state,
Config: m,
PlanMode: plans.DestroyMode,
})
_, diags := ctx.Plan()
if diags.HasErrors() {
t.Fatalf("plan: %s", diags.Err())
}
// backported from v1.1, but the apply will error in in v1.0
//_, diags = ctx.Apply(plan, m)
//if diags.HasErrors() {
// t.Fatalf("apply: %s", diags.Err())
//}
}
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)