Skip to content

ctest prerequisites 1#10655

Merged
Buristan merged 8 commits intotarantool:masterfrom
ligurio:ligurio/gh-xxxx-ctest-prerequisites
Oct 8, 2024
Merged

ctest prerequisites 1#10655
Buristan merged 8 commits intotarantool:masterfrom
ligurio:ligurio/gh-xxxx-ctest-prerequisites

Conversation

@ligurio
Copy link
Member

@ligurio ligurio commented Oct 7, 2024

Needed by #10216

@ligurio ligurio force-pushed the ligurio/gh-xxxx-ctest-prerequisites branch 3 times, most recently from 18456d7 to 5e324a4 Compare October 7, 2024 12:34
@coveralls
Copy link

coveralls commented Oct 7, 2024

Coverage Status

coverage: 87.304% (+0.006%) from 87.298%
when pulling 77dabd5 on ligurio:ligurio/gh-xxxx-ctest-prerequisites
into d927ae0
on tarantool:master
.

@ligurio ligurio requested review from Buristan and Totktonada October 7, 2024 13:55
Copy link
Contributor

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a nice code health activity.

@ligurio ligurio assigned Totktonada and unassigned ligurio and Totktonada Oct 7, 2024
@ligurio ligurio force-pushed the ligurio/gh-xxxx-ctest-prerequisites branch 2 times, most recently from 95ebd8c to e05da81 Compare October 7, 2024 16:22
@ligurio ligurio changed the title ctest prerequisites ctest prerequisites 1 Oct 7, 2024
@ligurio ligurio mentioned this pull request Oct 7, 2024
15 tasks
@ligurio ligurio requested a review from ImeevMA October 8, 2024 06:35
@ligurio
Copy link
Member Author

ligurio commented Oct 8, 2024

@ImeevMA, I've update a couple of SQL tests, please take a look on changes.

Copy link
Collaborator

@ImeevMA ImeevMA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to rename the test files to map_binding_test.lua and array_binding_test.lua to indicate that binding is tested separately. I think it would otherwise be quite odd to have two test-files with the same name implementing complementary rather than replacing tests.

@ligurio
Copy link
Member Author

ligurio commented Oct 8, 2024

I think it makes sense to rename the test files to map_binding_test.lua and array_binding_test.lua to indicate that binding is tested separately. I think it would otherwise be quite odd to have two test-files with the same name implementing complementary rather than replacing tests.

As discussed verbally with you, I've updated testcase names as in patch below:

diff --git a/test/sql-luatest/array_test.lua b/test/sql-luatest/array_test.lua
index fe40e3d12b..bbb566de66 100644
--- a/test/sql-luatest/array_test.lua
+++ b/test/sql-luatest/array_test.lua
@@ -13,7 +13,7 @@ g.after_all(function()
 end)
 
 -- Make sure that ARRAY values can be used as bound variable.
-g.test_builtins_14_1 = function()
+g.test_array_binding_local = function()
     g.server:exec(function()
         local sql = [[SELECT #a;]]
         local arg = {{['#a'] = {1, 2, 3}}}
@@ -21,7 +21,7 @@ g.test_builtins_14_1 = function()
     end)
 end
 
-g.test_builtins_14_2 = function()
+g.test_array_binding_remote = function()
     local conn = g.server.net_box
     local ok, res = pcall(conn.execute, conn, [[SELECT #a;]],
                           {{['#a'] = {1, 2, 3}}})
diff --git a/test/sql-luatest/map_test.lua b/test/sql-luatest/map_test.lua
index fefa4e7255..679907dcc9 100644
--- a/test/sql-luatest/map_test.lua
+++ b/test/sql-luatest/map_test.lua
@@ -322,7 +322,7 @@ g.test_map_9 = function()
 end
 
 -- Make sure that MAP values can be used as a bound variable.
-g.test_builtins_13_1 = function()
+g.test_map_binding_local = function()
     g.server:exec(function()
         local sql = [[SELECT #a;]]
         local arg = {{['#a'] = {abc = 2, [1] = 3}}}
@@ -331,7 +331,7 @@ g.test_builtins_13_1 = function()
     end)
 end
 
-g.test_builtins_13_2 = function()
+g.test_map_binding_remote = function()
     local conn = g.server.net_box
     local ok, res = pcall(conn.execute, conn, [[SELECT #a;]],
                           {{['#a'] = {abc = 2, [1] = 3}}})

@ligurio ligurio force-pushed the ligurio/gh-xxxx-ctest-prerequisites branch from e05da81 to 8bb6196 Compare October 8, 2024 07:48
Copy link
Collaborator

@Buristan Buristan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Sergey!
Thanks for the patchset!
It is nice to see that someone dusts off these old tests.

Generally LGTM, except a few minor nits and comments below:


[PATCH 1/8] cmake: remove duplicate definition

perf/CMakeLists.txt, the patch removes duplicate definition.

Typo: s/duplicate/the duplicate/


[PATCH 2/8] test: remove test in suite.ini

used error injection anymore, so it was removed in suite.ini.

Typo: s/error injection/the error injection/


[PATCH 3/8] test: remove feedback_daemon.skipcond

because depends on environment variable TRAVIS_JOB_ID.

Typo: s/depends/it depends/
Typo: s/environment/the environment/


[PATCH 4/8] test: fix test filename

triggered with patch for CTest support and breaks test generation:

Typo:s/patch/the patch/


[PATCH 5/8] test: use built tarantool instead a system one

The test gh_5747_crash_multiple_args_test.lua use a tarantool

Typo: s/use/uses/
Typo: s/tarantool/Tarantool/

In some cases, PATH may point to a system tarantool binary and

Typo: s/tarantool binary/Tarantool binary,/

set a path to tarantool binary derived from a command-line

Typo: s/tarantool binary/the Tarantool binary/

And the comment below.


[PATCH 6/8] test: fix minimal.test.lua

The patch set a patch to tarantool binary explicitly in the

Typo: s/patch/path/
Typo: s/tarantool/the Tarantool/


[PATCH 7/8] test: remove testcase for tarantoolctl

but this tools has been deprecated an removed for a long time.

Typo: s/tools/tool/
Typo: s/an/and/


[PATCH 8/8] test: replace testcase by luatest's testcases

The tests array.test.lua and map.test.lua requires remote

Typo: s/requires/require/
Typo: s/remote/the remote/

Tarantool instance for running testcases. When test are executed

Typo: s/test/tests/

by test-run.py it runs this Tarantool instance. The testcases that

Typo: s/test-run.py/test-run.py,/

require remote instance were ported to luatest to make tests able

Typo: s/remote/the remote/

@Buristan Buristan assigned ligurio and unassigned Buristan Oct 8, 2024
@Buristan Buristan added the full-ci Enables all tests for a pull request label Oct 8, 2024
`TARANTOOL_BIN` is already defined in a parent
`perf/CMakeLists.txt`, the patch removes the duplicate definition.

NO_CHANGELOG=codehealth
NO_DOC=codehealth
NO_TEST=codehealth
The test has been renamed in commit 16d6e9d
("console: remove ERRINJ_STDIN_ISATTY injection") and it is not
used the error injection anymore, so it was removed in suite.ini.

NO_CHANGELOG=codehealth
NO_DOC=codehealth
NO_TEST=codehealth
The aforementioned skipcond file is specific for Travis CI
because it depends on the environment variable `TRAVIS_JOB_ID`.
We have moved to GHA for a long time, it seems this skipcond is
not useful anymore.

NO_CHANGELOG=codehealth
NO_DOC=codehealth
NO_TEST=codehealth
According to CMake policy CMP0110 whitespaces and other special
characters are forbidden before CMake 3.19. This policy is
triggered with the patch for CTest support and breaks test
generation:

NO_WRAP
The following name given to add_test() is invalid if CMP0110 is not set or
set to OLD:

  `test/box-luatest/gh_7217_repeatable_{in, up}sert_memtx_tx_conflict_test.lua´
NO_WRAP

The patch renames file without using whitespaces and special
characters.

Required for CTest support. Follows up commit 654cf49
("memtx: fix story delete statement list").

1. https://cmake.org/cmake/help/latest/policy/CMP0110.html

NO_CHANGELOG=codehealth
NO_DOC=codehealth
NO_TEST=codehealth
The test gh_5747_crash_multiple_args_test.lua uses a `tarantool`
binary that is available in a current PATH environment variable.
In some cases, PATH may point to a system `tarantool` executable
and this could be unexpected for those who run the test. The patch
set a path to `tarantool` executable derived from a command-line
used to run the test.

NO_CHANGELOG=codehealth
NO_DOC=codehealth
The patch set a path to `tarantool` executable binary explicitly
in the aforementioned test.

NO_CHANGELOG=codehealth
NO_DOC=codehealth
The testcase `test_tarantoolctl_connect` tests `tarantoolctl`,
but this tool has been deprecated and removed for a long time.
The patch removes testcases as useless.

Follows up commit 216b624
("tools: remove tarantoolctl utility").

NO_CHANGELOG=codehealth
NO_DOC=codehealth
The tests `array.test.lua` and `map.test.lua` require the remote
Tarantool instance for running testcases. When tests are executed
by test-run.py, it runs this Tarantool instance. The testcases
that require the remote instance were ported to luatest to make
tests able to run with ctest. The testcases `builtins-13.1` and
`builtins-14.1` are companion testcases and were moved as well.

Required by patches for CTest support, because allows to
execute aforementioned tests without test-run.py.

NO_CHANGELOG=codehealth
NO_DOC=codehealth
NO_TEST=codehealth
@ligurio ligurio force-pushed the ligurio/gh-xxxx-ctest-prerequisites branch from 8bb6196 to 77dabd5 Compare October 8, 2024 12:50
@Buristan Buristan merged commit 47295fd into tarantool:master Oct 8, 2024
@ligurio ligurio deleted the ligurio/gh-xxxx-ctest-prerequisites branch October 8, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants