Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit dc0ec11

Browse files
committed
command: fix tests
1 parent 7221e01 commit dc0ec11

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

command/apply_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ func TestApply_vars(t *testing.T) {
487487
actual = v.(string)
488488
}
489489

490-
return nil, nil
490+
return &terraform.ResourceDiff{}, nil
491491
}
492492

493493
args := []string{
@@ -530,7 +530,7 @@ func TestApply_varFile(t *testing.T) {
530530
actual = v.(string)
531531
}
532532

533-
return nil, nil
533+
return &terraform.ResourceDiff{}, nil
534534
}
535535

536536
args := []string{

command/command_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func testStateFile(t *testing.T, s *terraform.State) string {
8585

8686
func testProvider() *terraform.MockResourceProvider {
8787
p := new(terraform.MockResourceProvider)
88+
p.DiffReturn = &terraform.ResourceDiff{}
8889
p.RefreshFn = func(
8990
s *terraform.ResourceState) (*terraform.ResourceState, error) {
9091
return s, nil

terraform/context.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc {
490490
// If this happened, then the diff above returned a bad diff.
491491
if diff == nil {
492492
return fmt.Errorf(
493-
"%s: diff became nil during Apply. This is a bug with " +
494-
"the resource provider. Please report a bug.")
493+
"%s: diff became nil during Apply. This is a bug with "+
494+
"the resource provider. Please report a bug.",
495+
r.Id)
495496
}
496497

497498
// Delete id from the diff because it is dependent on
@@ -506,8 +507,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc {
506507
"\n\nDiff 2: %#v",
507508
r.Diff, diff)
508509
return fmt.Errorf(
509-
"%s: diffs didn't match during apply. This is a " +
510-
"bug with the resource provider, please report a bug.")
510+
"%s: diffs didn't match during apply. This is a "+
511+
"bug with the resource provider, please report a bug.",
512+
r.Id)
511513
}
512514
}
513515

0 commit comments

Comments
 (0)