fix(errors): test failures (#10879)
* fix(errors): test failures * fix test
This commit is contained in:
parent
bdee3337d3
commit
401cf2f394
|
@ -143,7 +143,7 @@ func (s *abciTestSuite) TestABCIInfoStacktrace() {
|
|||
},
|
||||
}
|
||||
|
||||
const thisTestSrc = "github.com/cosmos/cosmos-sdk/types/errors.(*abciTestSuite).TestABCIInfoStacktrace"
|
||||
const thisTestSrc = "github.com/cosmos/cosmos-sdk/errors.(*abciTestSuite).TestABCIInfoStacktrace"
|
||||
|
||||
for testName, tc := range cases {
|
||||
_, _, log := ABCIInfo(tc.err, tc.debug)
|
||||
|
|
|
@ -48,9 +48,9 @@ func trimInternal(st errors.StackTrace) errors.StackTrace {
|
|||
// manual error creation, or runtime for caught panics
|
||||
for matchesFunc(st[0],
|
||||
// where we create errors
|
||||
"github.com/cosmos/cosmos-sdk/types/errors.Wrap",
|
||||
"github.com/cosmos/cosmos-sdk/types/errors.Wrapf",
|
||||
"github.com/cosmos/cosmos-sdk/types/errors.WithType",
|
||||
"github.com/cosmos/cosmos-sdk/errors.Wrap",
|
||||
"github.com/cosmos/cosmos-sdk/errors.Wrapf",
|
||||
"github.com/cosmos/cosmos-sdk/errors.WithType",
|
||||
// runtime are added on panics
|
||||
"runtime.",
|
||||
// _test is defined in coverage tests, causing failure
|
||||
|
|
|
@ -32,11 +32,11 @@ func (s *errorsTestSuite) TestStackTrace() {
|
|||
|
||||
// Wrapping code is unwanted in the errors stack trace.
|
||||
unwantedSrc := []string{
|
||||
"github.com/cosmos/cosmos-sdk/types/errors.Wrap\n",
|
||||
"github.com/cosmos/cosmos-sdk/types/errors.Wrapf\n",
|
||||
"github.com/cosmos/cosmos-sdk/errors.Wrap\n",
|
||||
"github.com/cosmos/cosmos-sdk/errors.Wrapf\n",
|
||||
"runtime.goexit\n",
|
||||
}
|
||||
const thisTestSrc = "types/errors/stacktrace_test.go"
|
||||
const thisTestSrc = "errors/stacktrace_test.go"
|
||||
|
||||
for _, tc := range cases {
|
||||
s.Require().True(reflect.DeepEqual(tc.err.Error(), tc.wantError))
|
||||
|
|
Loading…
Reference in New Issue