Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

updtaed integration test validation, allowing at least 1 results #101

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions provider/testing/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ func compareDataWithExpected(expected []ExpectedValue, received []map[string]int
toCompare[i] = nil // row passed verification - it won't be used
found++
}
// verification.Count == 0 means we expect at least 1 result
if verification.Count == 0 && found > 0 {
continue
}

if verification.Count != found {
return fmt.Errorf("expected to have %d but got %d entries with one of the %v\nerrors: %v", verification.Count, found, verification.Data, errors)
}
Expand Down