mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
helper/resource: improve logging and output for tests
This commit is contained in:
parent
8d065ce5c4
commit
91ad873113
@ -62,6 +62,12 @@ func (m *Map) Apply(
|
|||||||
if s.ID == "" {
|
if s.ID == "" {
|
||||||
result, err = r.Create(s, d, meta)
|
result, err = r.Create(s, d, meta)
|
||||||
} else {
|
} else {
|
||||||
|
if r.Update == nil {
|
||||||
|
return s, fmt.Errorf(
|
||||||
|
"Resource type '%s' doesn't support update",
|
||||||
|
s.Type)
|
||||||
|
}
|
||||||
|
|
||||||
result, err = r.Update(s, d, meta)
|
result, err = r.Update(s, d, meta)
|
||||||
}
|
}
|
||||||
if result != nil {
|
if result != nil {
|
||||||
|
@ -202,9 +202,11 @@ func testStep(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Plan!
|
// Plan!
|
||||||
if _, err := ctx.Plan(&terraform.PlanOpts{Destroy: step.Destroy}); err != nil {
|
if p, err := ctx.Plan(&terraform.PlanOpts{Destroy: step.Destroy}); err != nil {
|
||||||
return state, fmt.Errorf(
|
return state, fmt.Errorf(
|
||||||
"Error planning: %s", err)
|
"Error planning: %s", err)
|
||||||
|
} else {
|
||||||
|
log.Printf("[WARN] Test: Step plan: %s", p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply!
|
// Apply!
|
||||||
|
Loading…
Reference in New Issue
Block a user