e2e_storage:stop using deprecated framework.ExpectError

Signed-off-by: liyuerich <yue.li@daocloud.io>
This commit is contained in:
liyuerich
2023-08-31 18:35:36 +08:00
parent 7947052689
commit f55588fa0b
11 changed files with 78 additions and 31 deletions

View File

@@ -293,15 +293,6 @@ func (f *FailureError) backtrace() {
// }
var ErrFailure error = FailureError{}
// ExpectError expects an error happens, otherwise an exception raises
//
// Deprecated: use gomega.Expect().To(gomega.HaveOccurred()) or (better!) check
// specifically for the error that is expected with
// gomega.Expect().To(gomega.MatchError(gomega.ContainSubstring()))
func ExpectError(err error, explain ...interface{}) {
gomega.ExpectWithOffset(1, err).To(gomega.HaveOccurred(), explain...)
}
// ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func ExpectNoError(err error, explain ...interface{}) {
ExpectNoErrorWithOffset(1, err, explain...)