Skip to content

tests: add output to a version parse error #417

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

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
- '1.20'
- 'stable'
runs-on:
- macos-12
- macos-13
- macos-14
tarantool:
- brew
Expand Down Expand Up @@ -254,12 +254,6 @@ jobs:
with:
go-version: ${{ matrix.golang }}

# Workaround for Mac OS 12 testrace failure
# https://github.com/golang/go/issues/49138
- name: disable MallocNanoZone for macos-12
run: echo "MallocNanoZone=0" >> $GITHUB_ENV
if: matrix.runs-on == 'macos-12'

# Workaround issue https://github.com/tarantool/tt/issues/640
- name: Fix tt rocks
if: matrix.tarantool == 'brew'
Expand Down
20 changes: 5 additions & 15 deletions arrow/tarantool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ var opts = tarantool.Opts{
func TestInsert_invalid(t *testing.T) {
arrows := []struct {
arrow string
expected []iproto.Error
expected iproto.Error
}{
{
"",
// TODO: delete iproto.ER_ARROW_IPC_DECODE, see:
// https://github.com/tarantool/go-tarantool/issues/415
[]iproto.Error{iproto.ER_INVALID_MSGPACK, iproto.ER_ARROW_IPC_DECODE},
iproto.ER_INVALID_MSGPACK,
},
{
"00",
// TODO: delete iproto.ER_ARROW_IPC_DECODE, see:
// https://github.com/tarantool/go-tarantool/issues/415
[]iproto.Error{iproto.ER_INVALID_MSGPACK, iproto.ER_ARROW_IPC_DECODE},
iproto.ER_INVALID_MSGPACK,
},
{
"ffffffff70000000040000009effffff0400010004000000" +
Expand All @@ -59,7 +55,7 @@ func TestInsert_invalid(t *testing.T) {
"00000000000000000000000000000800000000000000000000000100000001000000" +
"0000000000000000000000000a00140004000c0010000c0014000400060008000c00" +
"00000000000000000000",
[]iproto.Error{iproto.ER_UNSUPPORTED},
iproto.ER_UNSUPPORTED,
},
}

Expand All @@ -78,13 +74,7 @@ func TestInsert_invalid(t *testing.T) {
_, err = conn.Do(req).Get()
ttErr := err.(tarantool.Error)

require.Contains(t, a.expected, ttErr.Code)
// TODO: replace the check with:
//
// require.Equal(t, a.expected, ttErr.Code)
//
// See:
// https://github.com/tarantool/go-tarantool/issues/415
require.Equal(t, a.expected, ttErr.Code)
})
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/google/uuid v1.3.0
github.com/shopspring/decimal v1.3.1
github.com/stretchr/testify v1.9.0
github.com/tarantool/go-iproto v1.0.1-0.20241010173538-44b6566ef267
github.com/tarantool/go-iproto v1.1.0
github.com/vmihailenco/msgpack/v5 v5.3.5
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tarantool/go-iproto v1.0.1-0.20241010173538-44b6566ef267 h1:GenzvYfP9io9aEdZFmnopfcBOXmJg6MgBWyd4t8z4oI=
github.com/tarantool/go-iproto v1.0.1-0.20241010173538-44b6566ef267/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo=
github.com/tarantool/go-iproto v1.1.0 h1:HULVOIHsiehI+FnHfM7wMDntuzUddO09DKqu2WnFQ5A=
github.com/tarantool/go-iproto v1.1.0/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo=
github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
Expand Down
8 changes: 4 additions & 4 deletions test_helpers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ func IsTarantoolVersionLess(majorMin uint64, minorMin uint64, patchMin uint64) (
parsed := tarantoolVersionRegexp.FindStringSubmatch(string(out))

if parsed == nil {
return true, errors.New("regexp parse failed")
return true, fmt.Errorf("failed to parse output %q", out)
}

if major, err = atoiUint64(parsed[1]); err != nil {
return true, fmt.Errorf("failed to parse major: %s", err)
return true, fmt.Errorf("failed to parse major from output %q: %w", out, err)
}

if minor, err = atoiUint64(parsed[2]); err != nil {
return true, fmt.Errorf("failed to parse minor: %s", err)
return true, fmt.Errorf("failed to parse minor from output %q: %w", out, err)
}

if patch, err = atoiUint64(parsed[3]); err != nil {
return true, fmt.Errorf("failed to parse patch: %s", err)
return true, fmt.Errorf("failed to parse patch from output %q: %w", out, err)
}

if major != majorMin {
Expand Down
Loading