-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: ignore db ordering in dbResponse feature #154
Conversation
@ikramanop, может ещё тесты добавить? |
Да, тесты можно в таком формате response_header_test.go |
Добавил простенькие тесты. |
@@ -72,35 +77,97 @@ func (c *ResponseDbChecker) Check(t models.TestInterface, result *models.Result) | |||
return errors, nil | |||
} | |||
|
|||
func compareDbResp(t models.TestInterface, result *models.Result) ([]error, error) { | |||
func compareDbRespWithoutOrdering(expected, actual []string, testName string) ([]error, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мне кажется, что можно сделать проще и читабельнее в разы, просто отредактировав исходную функцию проверки
import (
...
"sort"
...
)
...
func compareDbResp(expected, actual []string, testName string, query interface{}, reorder bool) ([]error, error) {
var errors []error
var actualJson interface{}
var expectedJson interface{}
if reorder {
sort.Strings(expected)
sort.Strings(actual)
}
...
bf0b76c
to
7433636
Compare
…e/ignore-db-ordering
🚀 PR was released in |
Добавлен новый тип comparisonParams - ignoreDbOrdering, который может использоваться для проверки результата dbQuery не по порядку