From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.mail.ru (smtp1.mail.ru [94.100.179.111]) (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 5653F469710 for ; Wed, 3 Jun 2020 10:03:46 +0300 (MSK) From: Oleg Babin References: <20200602221817.645015-1-gorcunov@gmail.com> <20200602221817.645015-13-gorcunov@gmail.com> Message-ID: Date: Wed, 3 Jun 2020 10:03:43 +0300 MIME-Version: 1.0 In-Reply-To: <20200602221817.645015-13-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v8 12/12] test: logger -- consider more cases List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Thanks for your patch! LGTM On 03/06/2020 01:18, Cyrill Gorcunov wrote: > Part-of #689 > > Signed-off-by: Cyrill Gorcunov > --- > test/app-tap/logger.test.lua | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/test/app-tap/logger.test.lua b/test/app-tap/logger.test.lua > index 48dc8af3e..6ad15724e 100755 > --- a/test/app-tap/logger.test.lua > +++ b/test/app-tap/logger.test.lua > @@ -1,7 +1,7 @@ > #!/usr/bin/env tarantool > > local test = require('tap').test('log') > -test:plan(44) > +test:plan(49) > > -- gh-3946: Assertion failure when using log_format() before box.cfg() > local log = require('log') > @@ -46,6 +46,19 @@ test:is(line:sub(-m:len()), m, m) > _, err = pcall(log.cfg, {format = 'unknown'}) > test:ok(err:find("log: \'format\' must be json,plain") ~= nil) > > +-- Test static arguments > +_, err = pcall(box.cfg, {log = "newname"}) > +test:ok(err:find("log: \'log\' can\'t be set dynamically") ~= nil) > + > +_, err = pcall(box.cfg, {log_nonblock = true}) > +test:ok(err:find("log: \'log_nonblock\' can\'t be set dynamically") ~= nil) > + > +_, err = pcall(log.cfg, {nonblock = true}) > +test:ok(err:find("log: \'nonblock\' can\'t be set dynamically") ~= nil) > + > +_, err = pcall(log.cfg, {log = "newname"}) > +test:ok(err:find("log: \'log\' can\'t be set dynamically") ~= nil) > + > -- Test that changes in log module are propagated > -- back to the box module correctly > box.cfg{ > @@ -59,6 +72,7 @@ test:is(box.cfg.log_level, 6, 'box level 6') > log.cfg({format='plain', level=5}) > test:is(box.cfg.log_format, 'plain', 'box sees plain format') > test:is(box.cfg.log_level, 5, 'box sees level change') > +test:ok(log.cfg.log == filename and box.cfg.log == filename, 'filename match') > > -- Test symbolic names for loglevels > log.cfg({level='fatal'}) >