Skip to content

Commit 1a01089

Browse files
DifferentialOrangeoleg-jukovec
authored andcommitted
code health: rewrite ext error test skip
Use skipIfLess helpers like in other test conditions. Follows #119
1 parent 265f96c commit 1a01089

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

test_helpers/utils.go

+16-33
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,22 @@ func SkipIfIdSupported(t *testing.T) {
142142
skipIfGreaterOrEqual(t, "id requests", 2, 10, 0)
143143
}
144144

145+
// SkipIfErrorExtendedInfoUnsupported skips test run if Tarantool without
146+
// IPROTO_ERROR (0x52) support is used.
147+
func SkipIfErrorExtendedInfoUnsupported(t *testing.T) {
148+
t.Helper()
149+
150+
skipIfLess(t, "error extended info", 2, 4, 1)
151+
}
152+
153+
// SkipIfErrorMessagePackTypeUnsupported skips test run if Tarantool without
154+
// MP_ERROR type over iproto support is used.
155+
func SkipIfErrorMessagePackTypeUnsupported(t *testing.T) {
156+
t.Helper()
157+
158+
skipIfLess(t, "error type in MessagePack", 2, 10, 0)
159+
}
160+
145161
// CheckEqualBoxErrors checks equivalence of tarantool.BoxError objects.
146162
//
147163
// Tarantool errors are not comparable by nature:
@@ -180,36 +196,3 @@ func CheckEqualBoxErrors(t *testing.T, expected tarantool.BoxError, actual taran
180196
}
181197
}
182198
}
183-
184-
// SkipIfErrorExtendedInfoUnsupported skips test run if Tarantool without
185-
// IPROTO_ERROR (0x52) support is used.
186-
func SkipIfErrorExtendedInfoUnsupported(t *testing.T) {
187-
t.Helper()
188-
189-
// Tarantool provides extended error info only since 2.4.1 version.
190-
isLess, err := IsTarantoolVersionLess(2, 4, 1)
191-
if err != nil {
192-
t.Fatalf("Could not check the Tarantool version")
193-
}
194-
195-
if isLess {
196-
t.Skip("Skipping test for Tarantool without error extended info support")
197-
}
198-
}
199-
200-
// SkipIfErrorExtendedInfoUnsupported skips test run if Tarantool without
201-
// MP_ERROR type over iproto support is used.
202-
func SkipIfErrorMessagePackTypeUnsupported(t *testing.T) {
203-
t.Helper()
204-
205-
// Tarantool error type over MessagePack supported only since 2.10.0 version.
206-
isLess, err := IsTarantoolVersionLess(2, 10, 0)
207-
if err != nil {
208-
t.Fatalf("Could not check the Tarantool version")
209-
}
210-
211-
if isLess {
212-
t.Skip("Skipping test for Tarantool without support of error type over MessagePack")
213-
t.Skip("Skipping test for Tarantool without error extended info support")
214-
}
215-
}

0 commit comments

Comments
 (0)