From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A61C926B488; Wed, 15 Feb 2023 11:11:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A61C926B488 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1676448709; bh=DLz35P1sBMcF9RqSW+VFfyHBCpdM2mlxsL4HYGiARRQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Dxl4zg2/KT5TNuIvuBsOio6tczlfzioP4UQs/fh7XCjeO6I7nB0jRE70bpp8EdunS bz7mqySjtKDHOsWMWcUfFqodkAzTzztHOCDPSfDOvLAYoax9SQyeWVG67I4wF/Sbjp MpGef/Iy5yAvttfPgiv2twy5rhLBfDmk5apMgpI4= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 12BF51A4E58 for ; Wed, 15 Feb 2023 11:11:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 12BF51A4E58 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1pSCtI-0006CF-5P; Wed, 15 Feb 2023 11:11:48 +0300 Date: Wed, 15 Feb 2023 11:08:16 +0300 To: Igor Munkin Message-ID: References: <73073fb24db65f59c8629f4f377faa9e52cb54af.1676304797.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73073fb24db65f59c8629f4f377faa9e52cb54af.1676304797.git.imun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9806C989EC2150E332707AF5C8463FB27632E61488AC5AD3D182A05F538085040CCBB8CA7A979DB1AFA7A48999E840E7C05B19B4BCAE955863145C14639B59AF4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C8DD139BC0BB8586EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377F69ABDCCC31D2058638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85B74F51AE2B1FFFDD74826B6D8A38FFC117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC6BA66BB79834B351A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520CCD848CCB6FE560CE5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6A1DCCEB63E2F10FB089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3438BC6CF312DA731565307166738431D1DEF6D94712F980BF9DD58C8D8033EC3642DDF88A89D530E01D7E09C32AA3244C4B68A6A315208E69F0F091F2F06C9C7151E887DA02A9F7BFFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojeiW+ccsIdaUtC7OSzHI4fw== X-DA7885C5: 94C2AF078EB8A5FDFB8AE5836E094E00C60AECD6170748CE6FF1288E7B2AAF2C262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73933AF1F914F131DBF5ED1DCE7EEA1F83FE1096DEB5207AEEDA0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 3/7] test: stop using utils.selfrun in tests X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Igor! Thanks for the patch! Generally LGTM, but please consider my entreaties about comments below. On 13.02.23, Igor Munkin wrote: > Unfortunately, is too complex to be maintained, so the > corresponding tests are split into two files: the test itself and the > script to be run by the test. As a result of the patch > helper is introduced: it inherits some approaches from , > but it's considered for more general use. > > Relates to tarantool/tarantool#8252 > > Signed-off-by: Igor Munkin > --- > diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > index dd02130c..f4795db0 100644 > --- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > +++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > @@ -3,52 +3,43 @@ local utils = require('utils') > --- Save the current coroutine and set the value to trigger > --- call the Lua routine instead of C implementation. > -local sandwich = require('libsandwich')(cfg.trigger) > +local script = utils.makecmd(arg, { It will be nice to drop a comment here and below, that `makecmd()` searches for <%testname%/script.lua>. > + -- TODO: Leave another toxic comment regarding SIP on macOS. Minor: This TODO is unnecessary, so feel free to delete this line. > + env = { DYLD_LIBRARY_PATH = os.getenv('DYLD_LIBRARY_PATH') }, > + redirect = '2>&1', > +}) > > -- Depending on trigger and hotloop values the following contexts > -- are possible: > -- * if trigger <= hotloop -> trace recording is aborted > -- * if trigger > hotloop -> trace is recorded but execution > -- leads to panic > -jit.opt.start("3", string.format("hotloop=%d", cfg.hotloop)) > +local hotloop = 1 > +local cases = { > + abort = { > + trigger = hotloop, > + expected = '#4427 still works', Side note: We may provide this message from here to avoid it copy-pasting in , but this reduces the test readability... At least, we need to call format twice in the test's payload, so for better good is not to do it. > + test = 'is', > + message = 'Trace is aborted', > + }, > + panic = { > + trigger = hotloop + 1, > + expected = 'Lua VM re%-entrancy is detected while executing the trace', > + test = 'like', > + message = 'Trace is compiled', > + }, > +} > diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua b/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua > new file mode 100644 > index 00000000..9ecd964e > --- /dev/null > +++ b/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua > diff --git a/test/tarantool-tests/lj-351-print-tostring-number.test.lua b/test/tarantool-tests/lj-351-print-tostring-number.test.lua > index da5b31be..72a9ec2b 100644 > --- a/test/tarantool-tests/lj-351-print-tostring-number.test.lua > +++ b/test/tarantool-tests/lj-351-print-tostring-number.test.lua > diff --git a/test/tarantool-tests/lj-351-print-tostring-number/script.lua b/test/tarantool-tests/lj-351-print-tostring-number/script.lua > new file mode 100644 > index 00000000..c3066f49 > diff --git a/test/tarantool-tests/lj-586-debug-non-string-error.test.lua b/test/tarantool-tests/lj-586-debug-non-string-error.test.lua > index f02353fe..dcb730a2 100644 > --- a/test/tarantool-tests/lj-586-debug-non-string-error.test.lua > +++ b/test/tarantool-tests/lj-586-debug-non-string-error.test.lua > diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua > index c46b93f0..cf92757c 100644 > --- a/test/tarantool-tests/lj-flush-on-trace.test.lua > +++ b/test/tarantool-tests/lj-flush-on-trace.test.lua > --- Save the current coroutine and set the value to trigger > --- call the Lua routine instead of C implementation. > -local flush = require('libflush')(cfg.trigger) > +local script = utils.makecmd(arg, { > + -- TODO: Leave another toxic comment regarding SIP on macOS. Minor: This TODO is unnecessary, so feel free to delete this line. > + env = { DYLD_LIBRARY_PATH = os.getenv('DYLD_LIBRARY_PATH') }, > + redirect = '2>&1', > +}) > diff --git a/test/tarantool-tests/lj-flush-on-trace/script.lua b/test/tarantool-tests/lj-flush-on-trace/script.lua > new file mode 100644 > index 00000000..d2c35534 > --- /dev/null > +++ b/test/tarantool-tests/lj-flush-on-trace/script.lua > diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua > index eb11d40d..41a7c22a 100644 > --- a/test/tarantool-tests/utils.lua > +++ b/test/tarantool-tests/utils.lua > +function M.makecmd(arg, opts) Please, add the comment about script location, it's good thing to commment, IMHO. > + return setmetatable({ > + LUABIN = M.luacmd(arg), > + SCRIPT = opts and opts.script or arg[0]:gsub('%.test%.lua$', '/script.lua'), > + ENV = opts and makeenv(opts.env) or '', Is this option is used only for DYLD_LIBRARY_PATH (as I can see for now)? Should we drop the comment about that here (that this is the main reason)? > + REDIRECT = opts and opts.redirect or '', > + }, { > + __call = function(self, ...) > + local cmd = ('