providers: Mention check number when acctest fails

This commit is contained in:
Paul Hinze 2016-01-28 17:56:19 -06:00
parent c23fe545f7
commit 24048b4dca
2 changed files with 4 additions and 4 deletions

View File

@ -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)
}
}

View File

@ -194,7 +194,7 @@ func TestComposeTestCheckFunc(t *testing.T) {
},
func(*terraform.State) error { return nil },
},
Result: "error",
Result: "Check 1/2 error: error",
},
{
@ -204,7 +204,7 @@ func TestComposeTestCheckFunc(t *testing.T) {
return fmt.Errorf("error")
},
},
Result: "error",
Result: "Check 2/2 error: error",
},
{