Skip to content

Commit

Permalink
Merge pull request hashicorp#4956 from hashicorp/phinze/better-acctes…
Browse files Browse the repository at this point in the history
…t-check-error

providers: Mention check number when acctest fails
  • Loading branch information
phinze committed Feb 2, 2016
2 parents dce2994 + 24048b4 commit 3b51ccf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions helper/resource/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ func testStep(
// into smaller pieces more easily.
func ComposeTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
return func(s *terraform.State) error {
for _, f := range fs {
for i, f := range fs {
if err := f(s); err != nil {
return err
return fmt.Errorf("Check %d/%d error: %s", i+1, len(fs), err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions helper/resource/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestComposeTestCheckFunc(t *testing.T) {
},
func(*terraform.State) error { return nil },
},
Result: "error",
Result: "Check 1/2 error: error",
},

{
Expand All @@ -204,7 +204,7 @@ func TestComposeTestCheckFunc(t *testing.T) {
return fmt.Errorf("error")
},
},
Result: "error",
Result: "Check 2/2 error: error",
},

{
Expand Down

0 comments on commit 3b51ccf

Please sign in to comment.