Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v8 03/14] test: fix luacheck warnings W113 in test/sql-tap
Date: Tue, 23 Feb 2021 22:25:58 +0100	[thread overview]
Message-ID: <bc283192-0d10-7920-6317-cee762dd85ec@tarantool.org> (raw)
In-Reply-To: <f67df35c-1938-884e-ef16-1b42f29eeb19@tarantool.org>

Hi! Thanks for the patch!

We are almost there.

See 3 comments below.

> diff --git a/test/sql-tap/badutf1.test.lua b/test/sql-tap/badutf1.test.lua
> index 654629bf7..f375fea0f 100755
> --- a/test/sql-tap/badutf1.test.lua
> +++ b/test/sql-tap/badutf1.test.lua
> @@ -93,8 +93,12 @@ test:do_test(
>      })
>  
>  -- commented as it uses utf16
> -if 0>0 then
> -sql("db2", "")
> +-- testcases are broken
> +-- https://github.com/tarantool/tarantool/issues/5743
> +local is_gh_5743_closed = false
> +if is_gh_5743_closed then
> +sql("db2", "") -- luacheck: ignore sql
> +local sql_exec = nil

>> For me it's not make sense. Replaced push/pop suppression with variable definition.

1. Lets at least be consistent and either use `-- luacheck` comments or
`= nil` hack. Not both, especially not on 2 adjacent lines. It simply
raises unnecessary questions why couldn't it be done in one way.

>  test:do_test(
>      "badutf-1.10",
>      function()> diff --git a/test/sql-tap/e_select1.test.lua b/test/sql-tap/e_select1.test.lua
> index 2a189582d..9ef5e7925 100755
> --- a/test/sql-tap/e_select1.test.lua
> +++ b/test/sql-tap/e_select1.test.lua
> @@ -1537,32 +1561,26 @@ test:do_select_tests(
>  -- considered equal to other NULL values and distinct from all non-NULL
>  -- values.
>  --
> --- MUST_WORK_TEST
> -if 0>0 then
> -db("nullvalue", "null")
>  test:do_select_tests(
>      "e_select-7.9",
>      {
> -        {"1", "SELECT NULL UNION ALL SELECT NULL", {null, null}},
> -        {"2", "SELECT NULL UNION     SELECT NULL", {null}},
> -        {"3", "SELECT NULL INTERSECT SELECT NULL", {null}},
> +        {"1", "SELECT NULL UNION ALL SELECT NULL", {"", ""}},
> +        {"2", "SELECT NULL UNION     SELECT NULL", {""}},
> +        {"3", "SELECT NULL INTERSECT SELECT NULL", {""}},
>          {"4", "SELECT NULL EXCEPT    SELECT NULL", {}},

2. But why? What was the effect of `db("nullvalue", "null")` in the
original tests? If you don't know then maybe it is worth leaving it
as is + adding `local null = box.NULL` or `local null = nil` so at
least we could preserve the test body unchanged for future
investigations.

To me it is not clear why null can be "". Empty string is not the
same as NULL.

The same for the other `db("nullvalue", "null")` removals where
`null` was used for anything. If there are such other places.

> -        {"5", "SELECT NULL UNION ALL SELECT 'ab'", {null, "ab"}},
> -        {"6", "SELECT NULL UNION     SELECT 'ab'", {null, "ab"}},
> +        {"5", "SELECT NULL UNION ALL SELECT 'ab'", {"", "ab"}},
> +        {"6", "SELECT NULL UNION     SELECT 'ab'", {"", "ab"}},
>          {"7", "SELECT NULL INTERSECT SELECT 'ab'", {}},
> -        {"8", "SELECT NULL EXCEPT    SELECT 'ab'", {null}},
> -        {"9", "SELECT NULL UNION ALL SELECT 0", {null, 0}},
> -        {"10", "SELECT NULL UNION     SELECT 0", {null, 0}},
> +        {"8", "SELECT NULL EXCEPT    SELECT 'ab'", {""}},
> +        {"9", "SELECT NULL UNION ALL SELECT 0", {"", 0}},
> +        {"10", "SELECT NULL UNION     SELECT 0", {"", 0}},
>          {"11", "SELECT NULL INTERSECT SELECT 0", {}},
> -        {"12", "SELECT NULL EXCEPT    SELECT 0", {null}},
> -        {"13", "SELECT c FROM q1 UNION ALL SELECT g FROM q3", {null, -42.47, "null", 2, 2}},
> -        {"14", "SELECT c FROM q1 UNION     SELECT g FROM q3", {null, -42.47, 2}},
> +        {"12", "SELECT NULL EXCEPT    SELECT 0", {""}},
> +        {"13", "SELECT c FROM q1 UNION ALL SELECT g FROM q3", {"", -42.47, "", 2, 2}},
> +        {"14", "SELECT c FROM q1 UNION     SELECT g FROM q3", {"", -42.47, 2}},
>          {"15", "SELECT c FROM q1 INTERSECT SELECT g FROM q3", {}},
> -        {"16", "SELECT c FROM q1 EXCEPT    SELECT g FROM q3", {null, -42.47}},
> +        {"16", "SELECT c FROM q1 EXCEPT    SELECT g FROM q3", {"", -42.47}},
>      })
> -
> -db("nullvalue", "")
> -end
> diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
> index ea25727a4..574faafd6 100755
> --- a/test/sql-tap/index1.test.lua
> +++ b/test/sql-tap/index1.test.lua
> @@ -585,7 +585,7 @@ test:do_test(
>          for i = 1, 50, 1 do
>              test:execsql(string.format("INSERT INTO t3 VALUES('x%sx',%s,0.%s)", i, i, i))
>          end
> -        local sql_search_count = 0
> +        -- luacheck: ignore X

3. Lets be consistent and not jump from one method to another.
We either use luacheck comments or `local X = nil` hacks. The same
for other similar inconsistencies in this and the rest of the patches.

>          return X(381, "X!cmd", [=[["concat",[["execsql","SELECT c FROM t3 WHERE b==10"]],["sql_search_count"]]]=])
>      end, {
>          -- <index-11.1>

  reply	other threads:[~2021-02-23 21:26 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 12:49 [Tarantool-patches] [PATCH v8 00/14] Fix luacheck warnings in test/sql and test/sql-tap Sergey Bronnikov via Tarantool-patches
2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 01/14] test: fix luacheck warnings in test/sql Sergey Bronnikov via Tarantool-patches
2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 02/14] test: remove functions to open and close SQL connection Sergey Bronnikov via Tarantool-patches
2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 03/14] test: fix luacheck warnings W113 in test/sql-tap Sergey Bronnikov via Tarantool-patches
2021-01-24 17:33   ` Vladislav Shpilevoy via Tarantool-patches
2021-02-06 17:52     ` Vladislav Shpilevoy via Tarantool-patches
2021-02-16 12:02     ` Sergey Bronnikov via Tarantool-patches
2021-02-23 21:25       ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-02-25 10:39         ` Sergey Bronnikov via Tarantool-patches
2021-02-26 23:42   ` Vladislav Shpilevoy via Tarantool-patches
2021-02-27 17:53     ` Sergey Bronnikov via Tarantool-patches
2021-02-28 15:30       ` Vladislav Shpilevoy via Tarantool-patches
2021-03-01 13:26         ` Sergey Bronnikov via Tarantool-patches
2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 " Sergey Bronnikov via Tarantool-patches
2021-01-24 17:34   ` Vladislav Shpilevoy via Tarantool-patches
2021-02-16 14:09     ` Sergey Bronnikov via Tarantool-patches
2021-02-23 21:26   ` Vladislav Shpilevoy via Tarantool-patches
2021-02-25 11:02     ` Sergey Bronnikov via Tarantool-patches
2021-02-26 23:42       ` Vladislav Shpilevoy via Tarantool-patches
2021-02-27 17:09         ` Sergey Bronnikov via Tarantool-patches
2021-02-28 15:30           ` Vladislav Shpilevoy via Tarantool-patches
2021-03-01 13:46             ` Sergey Bronnikov via Tarantool-patches
2021-03-01 21:27               ` Vladislav Shpilevoy via Tarantool-patches
2021-03-02  8:05                 ` Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 05/14] test: fix luacheck warnings W212 " Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 06/14] test: fix laucheck warnings W213 " Sergey Bronnikov via Tarantool-patches
2021-01-24 17:35   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-29 16:32     ` Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 07/14] test: fix luacheck warnings W231 " Sergey Bronnikov via Tarantool-patches
2021-01-24 17:35   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-29 22:39     ` Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 08/14] test: fix luacheck warnings W311 " Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 09/14] test: fix luacheck warnings W511 " Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 10/14] test: fix luacheck warnings W512 " Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 11/14] test: fix luacheck warnings W542 " Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 12/14] test: fix luacheck warnings W612, W613, W614 " Sergey Bronnikov via Tarantool-patches
2021-01-24 17:36   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-29 16:23     ` Sergey Bronnikov via Tarantool-patches
2021-01-29 21:50       ` Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 13/14] test: fix luacheck warnings W621 " Sergey Bronnikov via Tarantool-patches
2021-01-24 17:37   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-29 16:11     ` Sergey Bronnikov via Tarantool-patches
2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 14/14] luacheck: add issues for suppressed warnings Sergey Bronnikov via Tarantool-patches
2021-01-24 17:37   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-29 16:13     ` Sergey Bronnikov via Tarantool-patches
2021-03-01 21:37 ` [Tarantool-patches] [PATCH v8 00/14] Fix luacheck warnings in test/sql and test/sql-tap Vladislav Shpilevoy via Tarantool-patches
2021-03-02  9:47 ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc283192-0d10-7920-6317-cee762dd85ec@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v8 03/14] test: fix luacheck warnings W113 in test/sql-tap' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox