From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4BABA469719 for ; Wed, 26 Feb 2020 16:56:21 +0300 (MSK) Date: Wed, 26 Feb 2020 16:51:00 +0300 From: Igor Munkin Message-ID: <20200226135059.GJ404@tarantool.org> References: <20200117170801.34975-1-maria.khaydich@tarantool.org> <616330e3-950c-7e8a-d14b-ea81fb350611@tarantool.org> <1580141630.390723821@f500.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1580141630.390723821@f500.i.mail.ru> Subject: Re: [Tarantool-patches] [PATCH] box: netbox.self and connect should work interchangeably List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maria Khaydich Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy Masha, Thanks for the patch! I left some nits below, please consider them. Otherwise, LGTM. On 27.01.20, Maria Khaydich wrote: > > Thank you for the review! All fixes below >   > ---------------------------------------------------------------------- > Branch: > https://github.com/tarantool/tarantool/compare/eljashm/gh-4513-netbox.self-convert-tuples-to-table-type > Issue: > https://github.com/tarantool/tarantool/issues/4513 >   >  src/box/lua/net_box.lua                       |  8 +++- >  test/app-tap/debug.result                     |  8 ++-- >  test/box-tap/net.box.test.lua                 |  3 +- >  test/box/engine.cfg                           |  6 +++ >  ...ox-self-and-connect-interchangeable.result | 44 +++++++++++++++++++ >  ...-self-and-connect-interchangeable.test.lua | 20 +++++++++ >  test/box/suite.ini                            |  1 + >  7 files changed, 83 insertions(+), 7 deletions(-) >  create mode 100644 test/box/engine.cfg >  create mode 100644 test/box/gh-4513-netbox-self-and-connect-interchangeable.result >  create mode 100644 test/box/gh-4513-netbox-self-and-connect-interchangeable.test.lua > diff --git a/test/box-tap/net.box.test.lua b/test/box-tap/net.box.test.lua > index a46f28ad0..577e97d78 100755 > --- a/test/box-tap/net.box.test.lua > +++ b/test/box-tap/net.box.test.lua > @@ -30,5 +30,4 @@ test:ok(not pcall(function() conn.space._vspace:insert() end), "error handling") >  -- cleanup >  conn:close() >  inspector:cmd('stop server second with cleanup=1') > -test:check() > -os.exit(0) > +os.exit(test:check() and 0 or 1) The changes are fine but look like not related to the subj. > diff --git a/test/box/engine.cfg b/test/box/engine.cfg > diff --git a/test/box/gh-4513-netbox-self-and-connect-interchangeable.test.lua b/test/box/gh-4513-netbox-self-and-connect-interchangeable.test.lua > new file mode 100644 > index 000000000..5e8ae7465 > --- /dev/null > +++ b/test/box/gh-4513-netbox-self-and-connect-interchangeable.test.lua > @@ -0,0 +1,20 @@ > +netbox = require('net.box') > +test_run = require('test_run').new() > +remote = test_run:get_cfg('remote') == 'true' > +test_run:cmd("setopt delimiter ';'") > + > +nb = nil > +if remote then > +    box.schema.user.grant('guest','super') > +    nb = netbox.connect(box.cfg.listen) > +else > +    nb = netbox.self > +end; > + > +-- > +-- netbox:self and netbox:connect should work interchangeably > +-- > +test_run:cmd("setopt delimiter ''"); Minor: The line above relates to the nb initialization, so it's better been placed before the comment. It's totally minor, feel free to ignore. > +type(nb:eval('return box.tuple.new{1}')) -- table > +type(nb:eval('return box.error.new(1, "test error")')) -- string > +type(nb:eval('return box.NULL')) -- cdata > --  > 2.24.0 -- Best regards, IM