From 8dffb1efee3935b48bd274e00698fc7c68bb77b3 Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Fri, 29 Mar 2024 18:26:50 +0300 Subject: [PATCH] test: use coverage instead of equality to test error payload We are going to add missing 'user' payload field for ACCESS_DENIED error which will break current tests. Let fix tests to allow adding new payload fields for errors. Need for https://github.com/tarantool/tarantool/issues/9108 --- go.mod | 2 +- test_helpers/utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 802b8412..9cb338b6 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/google/uuid v1.3.0 github.com/shopspring/decimal v1.3.1 - github.com/stretchr/testify v1.7.1 + github.com/stretchr/testify v1.9.0 github.com/tarantool/go-iproto v1.0.0 github.com/vmihailenco/msgpack/v5 v5.3.5 ) diff --git a/test_helpers/utils.go b/test_helpers/utils.go index 5dba76ff..049dff92 100644 --- a/test_helpers/utils.go +++ b/test_helpers/utils.go @@ -244,7 +244,7 @@ func CheckEqualBoxErrors(t *testing.T, expected tarantool.BoxError, actual taran require.Equal(t, expected.Msg, actual.Msg) require.Equal(t, expected.Errno, actual.Errno) require.Equal(t, expected.Code, actual.Code) - require.Equal(t, expected.Fields, actual.Fields) + require.Subset(t, actual.Fields, expected.Fields) if expected.Prev != nil { // Stack depth is the same