From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <tarantool-patches-bounces@dev.tarantool.org>
Received: from [87.239.111.99] (localhost [127.0.0.1])
	by dev.tarantool.org (Postfix) with ESMTP id 131396EC40;
	Mon, 28 Jun 2021 02:16:21 +0300 (MSK)
DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 131396EC40
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev;
	t=1624835781; bh=i/EMIi+qmaHLYAoOcJmo5VZPzothk7fEjlAcXtI0yU8=;
	h=To:Cc:References:In-Reply-To:Date:Subject:List-Id:
	 List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
	 From:Reply-To:From;
	b=rFQQ9jC0fH+6b5H+FxHNZoS6vMgJz5ZYQj9GhJjE/dpDnylJrsSllzBuKHd6DE7gE
	 FgfuxfnKiPQwEbyHQIPGBcg3luph/oVWTsWVZDtEKznFA1YTPgqJAmACY2TXYJpV3+
	 SS0rLQPjyd2spVyV/mlpbMLki17689jC84n7V4Tk=
Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113])
 (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 D72FA6EC40
 for <tarantool-patches@dev.tarantool.org>;
 Mon, 28 Jun 2021 02:16:19 +0300 (MSK)
DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D72FA6EC40
Received: by smtp53.i.mail.ru with esmtpa (envelope-from
 <tsafin@tarantool.org>)
 id 1lxe0g-00073x-QX; Mon, 28 Jun 2021 02:16:19 +0300
To: "'Igor Munkin'" <imun@tarantool.org>
Cc: <alexander.turenko@tarantool.org>,
	<tarantool-patches@dev.tarantool.org>
References: <cover.1623396615.git.tsafin@tarantool.org>
 <d3639649921666f45b4110630ad4515b253b3675.1623396615.git.tsafin@tarantool.org>
 <20210620185759.GC10212@tarantool.org>
In-Reply-To: <20210620185759.GC10212@tarantool.org>
Date: Mon, 28 Jun 2021 02:16:14 +0300
Message-ID: <151601d76baa$6d360c70$47a22550$@tarantool.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQH9YP+QCEY6e5VusJ0O6Ha7mUcGiQNUyBTjAg9NfjOqsUXy8A==
Content-Language: ru
X-4EC0790: 10
X-7564579A: 646B95376F6C166E
X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FB2F1AA0EB8A504C8721532AB396CDCF09182A05F5380850409B8C49AE8C175791769B368B6DE61367EED7275F6B486896D1C0373C7B4A6AFA
X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C579B1C3ABE6C709C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7B114C2C2C20B7E62EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BD6CF32B5F8F9D404B7900EE8475FF5F73F89E782778DBEC0CC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C00AD5422731CA18C9735652A29929C6C4AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3E5A09A62F51BBAB6BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE75A9E79F66F1C28F3731C566533BA786AA5CC5B56E945C8DA
X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD70E3F9139E6911567E0CB8CE7576031D
X-C1DE0DAB: 0D63561A33F958A519CB7F988B28C0A19AF1D324D9C2B3331659AAF9E830DC66D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0
X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A5112A9AECFE11B10DF4F4D6340A28AED43687EB5371B5CEA9127462D9FFF0E8E39AFEFEA8B5A09D1D7E09C32AA3244C915BE88B7D8D8C5E44018A2824990A6130452B15D76AEC14FACE5A9C96DEB163
X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojBC0PCXY5SAXHdjpkUu0NFg==
X-Mailru-Sender: 6CA451E36783D721CBEA96CEA26D325D70E0604A2B4F2F72C42873FC58DC4349B7CBEF92542CD7C82F97C478340294DCC77752E0C033A69E0F0C7111264B8915FF1320A92A5534336C18EFA0BB12DBB0
X-Mras: Ok
Subject: Re: [Tarantool-patches] [PATCH v2 1/3] test: corrected reported
 error lines
X-BeenThere: tarantool-patches@dev.tarantool.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Tarantool development patches <tarantool-patches.dev.tarantool.org>
List-Unsubscribe: <https://lists.tarantool.org/mailman/options/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=unsubscribe>
List-Archive: <https://lists.tarantool.org/pipermail/tarantool-patches/>
List-Post: <mailto:tarantool-patches@dev.tarantool.org>
List-Help: <mailto:tarantool-patches-request@dev.tarantool.org?subject=help>
List-Subscribe: <https://lists.tarantool.org/mailman/listinfo/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=subscribe>
From: Timur Safin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
Reply-To: Timur Safin <tsafin@tarantool.org>
Errors-To: tarantool-patches-bounces@dev.tarantool.org
Sender: "Tarantool-patches" <tarantool-patches-bounces@dev.tarantool.org>


: From: Igor Munkin <imun@tarantool.org>
: Subject: Re: [Tarantool-patches] [PATCH v2 1/3] test: corrected reported
: error lines
: 
: Timur,
: 
: Thanks for the patch! Though the change is quite trivial, the patch is
: not OK right from the top. Please adjust the commit subject according to
: our contribution guidelines[1].

Much thanks Sasha for his useful proposal, not thanks to Igor for useless
referring to guidelines without suggestion.

...
: You can argue that this is a trivial oneliner and I am making lot of ado
: about nothing, 

Exactly. 
...
: 
: However, there are several nits to be resolved,
: so please move this patch out from this series in a separate one.

Will do

: 
: On 11.06.21, Timur Safin via Tarantool-patches wrote:
: > It always was a problem that reported source line was not
: > pointing to the actual callee line number, but rather to
: 
: Don't get why you are talking about callee here: regardless the line to
: be reported (the current one or the one where the function is defined),
: it is a *caller* for the <traceback> function.

Yes, that was caller source line I was referring to. Thanks for correction.

: 
: So, the actual problem you're writing is that the line with function
: signature is used instead of the line where the function execution is
: stopped at the moment of the <traceback> call.
: 
: As for me, these are the different reasons.
: 
: > the start of file, i.e. we have seen:
: > ```
: > [001] sql-tap/tkt-9a8b09f8e6.test.lua                 memtx
: > [001] not ok 22 - 4.3 #
: > [001] Traceback:
: > [001] [Lua ] function 'do_catchsql_test' at
: </home/tsafin/tarantool/test/var/001_sql-tap/sqltester.lua:123>
: > [001] [main] at </home/tsafin/tarantool/test/sql-tap/tkt-
: 9a8b09f8e6.test.lua:0>
: > [001]
: > [001] not ok 23 - 4.4 #
: > [001] Traceback:
: > [001] [Lua ] function 'do_catchsql_test' at
: </home/tsafin/tarantool/test/var/001_sql-tap/sqltester.lua:123>
: > [001] [main] at </home/tsafin/tarantool/test/sql-tap/tkt-
: 9a8b09f8e6.test.lua:0>
: > ```
: > (see the :0 part)
: 
: Minor: Strictly saying :123 part is also broken. 

O_o, why? Could you please clarify? We report it as line number in the 
source file, in this case tkt-9a8b09f8e6.test.lua:123 was exactly the
caller location?

: The only difference
: between them is that :0 line is used for so called "main" function.
: 
: > Instead of correct line numbers:
: > ```
: > [001] sql-tap/tkt-9a8b09f8e6.test.lua                 memtx
: > [001] not ok 22 - 4.3 #
: > [001] Traceback:
: > [001] [Lua ] function 'do_catchsql_test' at
: </home/tsafin/tarantool/test/var/001_sql-tap/sqltester.lua:142>
: > [001] [main] at </home/tsafin/tarantool/test/sql-tap/tkt-
: 9a8b09f8e6.test.lua:242>
: > [001]
: > [001] not ok 23 - 4.4 #
: > [001] Traceback:
: > [001] [Lua ] function 'do_catchsql_test' at
: </home/tsafin/tarantool/test/var/001_sql-tap/sqltester.lua:142>
: > [001] [main] at </home/tsafin/tarantool/test/sql-tap/tkt-
: 9a8b09f8e6.test.lua:252>
: > ```
: >
: > The problem was due to `.linedefined` used, instead of source line in
: `.currentline`.
: 
: Typo: The line exceeds 72 chars.

Ok. 

: 
: >
: > Closes #6134
: > ---
: >  src/lua/tap.lua | 2 +-
: >  1 file changed, 1 insertion(+), 1 deletion(-)
: >
: > diff --git a/src/lua/tap.lua b/src/lua/tap.lua
: > index 346724d84..77fd8d096 100644
: > --- a/src/lua/tap.lua
: > +++ b/src/lua/tap.lua
: > @@ -23,7 +23,7 @@ local function traceback(level)
: >          local frame = {
: >              source = info.source;
: >              src = info.short_src;
: > -            line = info.linedefined or 0;
: > +            line = info.currentline or info.linedefined or 0;
: 
: Why did you leave such a complex code here? I believe you can use just
: info.currentline here.

Just in case :), if currentline may be missing in the traceback object 
for any reason. If it's impossible for the set of requested flags, then
I'll get rid of linedefined here.

: 
: [1]:
: https://www.tarantool.io/en/doc/latest/dev_guide/developer_guidelines/#how-
: to-write-a-commit-message
: 
: --
: Best regards,
: IM

Thanks,
Timur