Skip to content

Commit 24048b4

Browse files
committed
providers: Mention check number when acctest fails
1 parent c23fe54 commit 24048b4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎helper/resource/testing.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ func testStep(
316316
// into smaller pieces more easily.
317317
func ComposeTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
318318
return func(s *terraform.State) error {
319-
for _, f := range fs {
319+
for i, f := range fs {
320320
if err := f(s); err != nil {
321-
return err
321+
return fmt.Errorf("Check %d/%d error: %s", i+1, len(fs), err)
322322
}
323323
}
324324

‎helper/resource/testing_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func TestComposeTestCheckFunc(t *testing.T) {
194194
},
195195
func(*terraform.State) error { return nil },
196196
},
197-
Result: "error",
197+
Result: "Check 1/2 error: error",
198198
},
199199

200200
{
@@ -204,7 +204,7 @@ func TestComposeTestCheckFunc(t *testing.T) {
204204
return fmt.Errorf("error")
205205
},
206206
},
207-
Result: "error",
207+
Result: "Check 2/2 error: error",
208208
},
209209

210210
{

0 commit comments

Comments
 (0)