From d596a19135adba5671bb854d2b66dbfacc6bc76c Mon Sep 17 00:00:00 2001 From: Oleg Chaplashkin Date: Tue, 14 May 2024 16:47:07 +0400 Subject: [PATCH] Add Tarantool 2.11 and 3.0 to tests workflow We've switched to using the `tt` utility instead of `tarantoolctl` when testing on versions 3.0 [1]. We've also fixed the tests for `box.tuple`, so the interface of `new()` function has changed [2]. [1] tarantool/tarantool#9443 [2] https://github.com/tarantool/tarantool/releases/tag/3.0.0 --- .github/workflows/test_on_push.yaml | 9 ++++++-- CMakeLists.txt | 10 ++++---- test/luatest_test.lua | 36 ++++++++++++++--------------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index fcabca1d..1980eb5f 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -11,15 +11,20 @@ jobs: github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'tarantool' strategy: matrix: - tarantool: ["1.10", "2.6", "2.7", "2.8", "2.10"] + tarantool: ["1.10", "2.6", "2.7", "2.8", "2.10", "2.11", "3.0"] fail-fast: false runs-on: [ubuntu-20.04] steps: - uses: actions/checkout@master - - uses: tarantool/setup-tarantool@v1 + - uses: tarantool/setup-tarantool@v3 with: tarantool-version: '${{ matrix.tarantool }}' + - name: Install tt utility + run: | + curl -L https://tarantool.io/GcTQaQl/release/2/installer.sh | bash + sudo apt-get -y install tt + - name: Install requirements for community run: | cmake -S . -B build diff --git a/CMakeLists.txt b/CMakeLists.txt index e3a2997f..51739078 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,10 @@ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES .rocks) add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/.rocks DEPENDS ${PROJECT_NAME}-scm-1.rockspec - COMMAND tarantoolctl rocks make ./${PROJECT_NAME}-scm-1.rockspec - COMMAND tarantoolctl rocks install http 1.1.0 - COMMAND tarantoolctl rocks install luacheck 0.25.0 - COMMAND tarantoolctl rocks install luacov 0.13.0 + COMMAND tt rocks make ./${PROJECT_NAME}-scm-1.rockspec + COMMAND tt rocks install http 1.1.0 + COMMAND tt rocks install luacheck 0.25.0 + COMMAND tt rocks install luacov 0.13.0 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ) @@ -51,7 +51,7 @@ add_custom_target(bootstrap DEPENDS ${PROJECT_SOURCE_DIR}/.rocks) add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/.rocks/bin/ldoc DEPENDS bootstrap - COMMAND tarantoolctl rocks install ldoc --server=http://rocks.moonscript.org + COMMAND tt rocks install ldoc --server=http://rocks.moonscript.org WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ) diff --git a/test/luatest_test.lua b/test/luatest_test.lua index bfadf241..87a85f16 100644 --- a/test/luatest_test.lua +++ b/test/luatest_test.lua @@ -40,26 +40,26 @@ g.test_assert_is_box_null = function() end g.test_assert_equals_tnt_tuples = function() - t.assert_equals(box.tuple.new(1), box.tuple.new(1)) - t.assert_equals(box.tuple.new(1, 'a', box.NULL), box.tuple.new(1, 'a', box.NULL)) - t.assert_equals(box.tuple.new(1, {'a'}), box.tuple.new(1, {'a'})) - t.assert_equals({box.tuple.new(1)}, {box.tuple.new(1)}) - t.assert_equals({box.tuple.new(1)}, {{1}}) - helper.assert_failure(t.assert_equals, box.tuple.new(1), box.tuple.new(2)) - - t.assert_not_equals(box.tuple.new(1), box.tuple.new(2)) - t.assert_not_equals(box.tuple.new(1, 'a', box.NULL, {}), box.tuple.new(1, 'a')) - t.assert_not_equals(box.tuple.new(1, {'a'}), box.tuple.new(1, {'b'})) - helper.assert_failure(t.assert_not_equals, box.tuple.new(1), box.tuple.new(1)) + t.assert_equals(box.tuple.new({1}), box.tuple.new({1})) + t.assert_equals(box.tuple.new({1, 'a', box.NULL}), box.tuple.new({1, 'a', box.NULL})) + t.assert_equals(box.tuple.new({1, {'a'}}), box.tuple.new({1, {'a'}})) + t.assert_equals({box.tuple.new({1})}, {box.tuple.new({1})}) + t.assert_equals({box.tuple.new({1})}, {{1}}) + helper.assert_failure(t.assert_equals, box.tuple.new({1}), box.tuple.new({2})) + + t.assert_not_equals(box.tuple.new({1}), box.tuple.new({2})) + t.assert_not_equals(box.tuple.new({1, 'a', box.NULL, {}}), box.tuple.new({1, 'a'})) + t.assert_not_equals(box.tuple.new({1, {'a'}}), box.tuple.new({1, {'b'}})) + helper.assert_failure(t.assert_not_equals, box.tuple.new({1}), box.tuple.new({1})) -- Check that other cdata values works fine. t.assert_equals(1ULL, 0ULL + 1) end -g.test_assert_items_equals_tnt_tuples = function() - t.assert_items_equals({box.tuple.new(1)}, {box.tuple.new(1)}) +g.test_assert_items_equals_tnt_tuples_v3 = function() + t.assert_items_equals({box.tuple.new({1})}, {box.tuple.new({1})}) helper.assert_failure_contains('Item values of the tables are not identical', - t.assert_items_equals, {box.tuple.new(1)}, {box.tuple.new(2)}) + t.assert_items_equals, {box.tuple.new({1})}, {box.tuple.new({2})}) end g.test_fail_if_tnt_specific = function() @@ -115,14 +115,14 @@ g.test_assert_covers = function() subject({a = 1, b = 2, c = 3}, {a = 1, c = 3}) subject({a = 1, b = 2, c = 3}, {a = 1, b = 2, c = 3}) subject({a = box.NULL}, {a = box.NULL}) - subject({a = box.tuple.new(1)}, {a = box.tuple.new(1)}) + subject({a = box.tuple.new({1})}, {a = box.tuple.new({1})}) helper.assert_failure(subject, {a = 1, b = 2, c = 3}, {a = 2}) helper.assert_failure(subject, {a = 1, b = 2, c = 3}, {a = 1, b = 1}) helper.assert_failure(subject, {a = 1, b = 2, c = 3}, {a = 1, b = 2, c = 3, d = 4}) helper.assert_failure(subject, {a = 1, b = 2, c = 3}, {d = 1}) helper.assert_failure(subject, {a = nil}, {a = box.NULL}) - helper.assert_failure(subject, {a = box.tuple.new(1)}, {a = box.tuple.new(2)}) + helper.assert_failure(subject, {a = box.tuple.new({1})}, {a = box.tuple.new({2})}) helper.assert_failure_contains('Argument 1 and 2 must be tables', subject, {a = 1, b = 2, c = 3}, nil) end @@ -144,9 +144,9 @@ end g.test_assert_items_include = function() local subject = t.assert_items_include - subject({1, box.tuple.new(1)}, {box.tuple.new(1)}) + subject({1, box.tuple.new({1})}, {box.tuple.new({1})}) - helper.assert_failure(subject, {box.tuple.new(1)}, {box.tuple.new(2)}) + helper.assert_failure(subject, {box.tuple.new({1})}, {box.tuple.new({2})}) end g.test_assert_type = function()