diff --git a/sbroad-cartridge/Makefile b/sbroad-cartridge/Makefile index ec80d43718b429ce7c16f1f5afe48cadd7d0ad32..ef09c2bfbe3ba8aef98ecf63545db6880edc2371 100644 --- a/sbroad-cartridge/Makefile +++ b/sbroad-cartridge/Makefile @@ -23,18 +23,8 @@ build_cartridge_engine_debug: build_integration: cartridge build $(TEST_APP) -test_wo_replication: - cd $(TEST_APP) && rm -rf tmp/tarantool_integration.log && TARANTOOL_LOG_LEVEL=5 TARANTOOL_LOG=tmp/tarantool_integration.log ./.rocks/bin/luatest --coverage -v test/integration/ && cd .. - -test_w_replication: - cd $(TEST_APP) && rm -rf tmp/tarantool_configuration.log && TARANTOOL_LOG_LEVEL=5 TARANTOOL_LOG=tmp/tarantool_configuration.log ./.rocks/bin/luatest --coverage -v test/configuration/ && cd .. - run_integration: - @$(MAKE) test_wo_replication;\ - EXIT_CODE_1=$$?;\ - $(MAKE) test_w_replication;\ - EXIT_CODE_2=$$?;\ - exit $$EXIT_CODE_1 && $$EXIT_CODE_2 + cd $(TEST_APP) && rm -rf tmp/tarantool_configuration.log && TARANTOOL_LOG_LEVEL=5 TARANTOOL_LOG=tmp/tarantool.log ./.rocks/bin/luatest --coverage -v test/ && cd .. install_debug: mkdir -p $(LUADIR)/$(PROJECT_NAME) diff --git a/sbroad-cartridge/test_app/test/helper/cluster_async_replication.lua b/sbroad-cartridge/test_app/test/helper/cluster_async_replication.lua index a975070b06cdadc976bafaa5c45bad6b78fe0322..35f1eaafeef1821916e6546080149c7ca06a80fe 100644 --- a/sbroad-cartridge/test_app/test/helper/cluster_async_replication.lua +++ b/sbroad-cartridge/test_app/test/helper/cluster_async_replication.lua @@ -63,12 +63,4 @@ helper.stop_test_cluster = function () helper.cluster:stop() end -t.before_suite(function() - helper.start_test_cluster(config) -end) - -t.after_suite(function() - helper.stop_test_cluster() -end) - return helper diff --git a/sbroad-cartridge/test_app/test/helper/cluster_no_replication.lua b/sbroad-cartridge/test_app/test/helper/cluster_no_replication.lua index b532289709d975a23e6c6c7dae4ff9de20a746e4..35725ecdcac42d8375d65a9c54b581d552c4bd0d 100644 --- a/sbroad-cartridge/test_app/test/helper/cluster_no_replication.lua +++ b/sbroad-cartridge/test_app/test/helper/cluster_no_replication.lua @@ -17,7 +17,7 @@ helper.datadir = fio.pathjoin(helper.root, 'tmp', 'db_test') helper.server_command = fio.pathjoin(helper.root, 'init.lua') helper.grep_log = function(what, bytes) - local filename = fio.pathjoin(helper.root, 'tmp', 'tarantool_integration.log') + local filename = fio.pathjoin(helper.root, 'tmp', 'tarantool.log') local file = fio.open(filename, {'O_RDONLY', 'O_NONBLOCK'}) local function fail(msg) @@ -122,12 +122,4 @@ helper.stop_test_cluster = function () helper.cluster:stop() end -t.before_suite(function() - helper.start_test_cluster(config) -end) - -t.after_suite(function() - helper.stop_test_cluster() -end) - return helper diff --git a/sbroad-cartridge/test_app/test/integration/api_test.lua b/sbroad-cartridge/test_app/test/integration/api_test.lua index bb4063aae8be8471fbfc7623c27829c59052531e..dfa149a10cab67352bf214379364d93bd9f14725 100644 --- a/sbroad-cartridge/test_app/test/integration/api_test.lua +++ b/sbroad-cartridge/test_app/test/integration/api_test.lua @@ -4,11 +4,10 @@ local g = t.group('integration_api') local helper = require('test.helper.cluster_no_replication') local cluster = nil -g.before_all( - function() +g.before_all(function() + helper.start_test_cluster(helper.cluster_config) cluster = helper.cluster - end -) +end) g.before_each( function() @@ -82,6 +81,10 @@ g.after_each( end ) +g.after_all(function() + helper.stop_test_cluster() +end) + g.test_bucket_id_calculation = function() local api = cluster:server("api-1").net_box @@ -261,6 +264,7 @@ g.test_complex_shard_key_query = function() { 1, "123", 1, 360 } }, }) + end g.test_null_col_result = function() diff --git a/sbroad-cartridge/test_app/test/integration/array_test.lua b/sbroad-cartridge/test_app/test/integration/array_test.lua index f01bf232a756277ecbce15ccf4e8d331bd03f024..553ffe28677b93eb9be8eb8cf046275c342b4ed9 100644 --- a/sbroad-cartridge/test_app/test/integration/array_test.lua +++ b/sbroad-cartridge/test_app/test/integration/array_test.lua @@ -3,81 +3,77 @@ local g = t.group('array_field') local helper = require('test.helper.cluster_no_replication') g.before_all( - function() - helper.stop_test_cluster() + function() + --helper.stop_test_cluster() - local cfg = { - schema = { - spaces = { - t = { - format = { - { - name = "id", - type = "integer", - is_nullable = false, - }, - { - name = "a", - type = "array", - is_nullable = false, - }, - { - name = "bucket_id", - type = "unsigned", - is_nullable = true, - }, + local cfg = { + schema = { + spaces = { + t = { + format = { + { + name = "id", + type = "integer", + is_nullable = false, + }, + { + name = "a", + type = "array", + is_nullable = false, + }, + { + name = "bucket_id", + type = "unsigned", + is_nullable = true, }, - temporary = false, - engine = "memtx", - indexes = { - { - unique = true, - parts = { - { - path = "id", - type = "integer", - is_nullable = false, - }, + }, + temporary = false, + engine = "memtx", + indexes = { + { + unique = true, + parts = { + { + path = "id", + type = "integer", + is_nullable = false, }, - type = "TREE", - name = "id", }, - { - unique = false, - parts = { - { - path = "bucket_id", - type = "unsigned", - is_nullable = true, - }, + type = "TREE", + name = "id", + }, + { + unique = false, + parts = { + { + path = "bucket_id", + type = "unsigned", + is_nullable = true, }, - type = "TREE", - name = "bucket_id", }, + type = "TREE", + name = "bucket_id", }, - is_local = false, - sharding_key = { "id" }, - sharding_func = "crud_sharding_func" }, - } + is_local = false, + sharding_key = { "id" }, + sharding_func = "crud_sharding_func" + }, } } + } - helper.start_test_cluster(cfg) + helper.start_test_cluster(cfg) - local api = helper.cluster:server("api-1").net_box - local _, err = api:call('crud.insert', {'t', {1, { 1, 2, 'a' }, box.NULL}}) - t.assert_equals(err, nil) - end + local api = helper.cluster:server("api-1").net_box + local _, err = api:call('crud.insert', {'t', {1, { 1, 2, 'a' }, box.NULL}}) + t.assert_equals(err, nil) + end ) -g.after_all( - function() - helper.stop_test_cluster() - - helper.start_test_cluster(helper.cluster_config) - end -) +g.after_all(function() + helper.stop_test_cluster() +end) g.test_array_read = function () local api = helper.cluster:server("api-1").net_box diff --git a/sbroad-cartridge/test_app/test/integration/ddl_test.lua b/sbroad-cartridge/test_app/test/integration/ddl_test.lua index a0d87a7b0613d42ac644675611aa71515da6eed2..7a1b42e20a9b245dc4cc3bad50751ec9f7ebfafb 100644 --- a/sbroad-cartridge/test_app/test/integration/ddl_test.lua +++ b/sbroad-cartridge/test_app/test/integration/ddl_test.lua @@ -5,29 +5,31 @@ local helper = require('test.helper.cluster_no_replication') local cluster = nil g.before_all( - function() - cluster = helper.cluster + function() + helper.start_test_cluster(helper.cluster_config) + cluster = helper.cluster - local storage1 = cluster:server("storage-1-1").net_box - storage1:call("box.execute", { [[truncate table "broken_hot"]] }) - storage1:call("box.execute", { [[truncate table "BROKEN"]] }) + local storage1 = cluster:server("storage-1-1").net_box + storage1:call("box.execute", { [[truncate table "broken_hot"]] }) + storage1:call("box.execute", { [[truncate table "BROKEN"]] }) - local storage2 = cluster:server("storage-2-1").net_box - storage2:call("box.execute", { [[truncate table "broken_hot"]] }) - storage2:call("box.execute", { [[truncate table "BROKEN"]] }) - end + local storage2 = cluster:server("storage-2-1").net_box + storage2:call("box.execute", { [[truncate table "broken_hot"]] }) + storage2:call("box.execute", { [[truncate table "BROKEN"]] }) + end ) g.after_all( - function() - local storage1 = cluster:server("storage-1-1").net_box - storage1:call("box.execute", { [[truncate table "broken_hot"]] }) - storage1:call("box.execute", { [[truncate table "BROKEN"]] }) - - local storage2 = cluster:server("storage-2-1").net_box - storage2:call("box.execute", { [[truncate table "broken_hot"]] }) - storage2:call("box.execute", { [[truncate table "BROKEN"]] }) - end + function() + local storage1 = cluster:server("storage-1-1").net_box + storage1:call("box.execute", { [[truncate table "broken_hot"]] }) + storage1:call("box.execute", { [[truncate table "BROKEN"]] }) + + local storage2 = cluster:server("storage-2-1").net_box + storage2:call("box.execute", { [[truncate table "broken_hot"]] }) + storage2:call("box.execute", { [[truncate table "BROKEN"]] }) + helper.stop_test_cluster() + end ) g.test_insert_after_index = function() diff --git a/sbroad-cartridge/test_app/test/integration/explain_test.lua b/sbroad-cartridge/test_app/test/integration/explain_test.lua index 2a829a348152f2595c54b522dbc9c9ba36cb09fb..269123ad2005377bb931c2f87e9b3bd11e1680f2 100644 --- a/sbroad-cartridge/test_app/test/integration/explain_test.lua +++ b/sbroad-cartridge/test_app/test/integration/explain_test.lua @@ -4,11 +4,10 @@ local g = t.group('integration_api.explain') local helper = require('test.helper.cluster_no_replication') local cluster = nil -g.before_all( - function() +g.before_all(function() + helper.start_test_cluster(helper.cluster_config) cluster = helper.cluster - end -) +end) g.before_each( function() @@ -70,6 +69,10 @@ g.after_each( end ) +g.after_all(function() + helper.stop_test_cluster() +end) + g.test_motion_explain = function() local api = cluster:server("api-1").net_box diff --git a/sbroad-cartridge/test_app/test/integration/insert_test.lua b/sbroad-cartridge/test_app/test/integration/insert_test.lua index f9be0faa55dca3961aca29d5655ec0c8564741d5..edc7a3e11c0652d4342827207ac663dfcc0be01a 100644 --- a/sbroad-cartridge/test_app/test/integration/insert_test.lua +++ b/sbroad-cartridge/test_app/test/integration/insert_test.lua @@ -4,11 +4,10 @@ local g = t.group('integration_api.insert') local helper = require('test.helper.cluster_no_replication') local cluster = nil -g.before_all( - function() +g.before_all(function() + helper.start_test_cluster(helper.cluster_config) cluster = helper.cluster - end -) +end) g.before_each( function() @@ -60,6 +59,10 @@ g.after_each( end ) +g.after_all(function() + helper.stop_test_cluster() +end) + g.test_insert_1 = function() local api = cluster:server("api-1").net_box diff --git a/sbroad-cartridge/test_app/test/integration/large_query_test.lua b/sbroad-cartridge/test_app/test/integration/large_query_test.lua index f6a900686089e78a34f60a5dfe5cc826cb3abee0..ca0a42478e3d4b0306d46b7b294254c534526517 100644 --- a/sbroad-cartridge/test_app/test/integration/large_query_test.lua +++ b/sbroad-cartridge/test_app/test/integration/large_query_test.lua @@ -5,8 +5,6 @@ local data = require('test.data.test_data') g.before_all( function() - helper.stop_test_cluster() - local cfg = { schema = { spaces = { @@ -132,13 +130,9 @@ g.before_all( end ) -g.after_all( - function() - helper.stop_test_cluster() - - helper.start_test_cluster(helper.cluster_config) - end -) +g.after_all(function() + helper.stop_test_cluster() +end) g.test_schema_invalid = function () local api = helper.cluster:server("api-1").net_box diff --git a/sbroad-cartridge/test_app/test/integration/motion_test.lua b/sbroad-cartridge/test_app/test/integration/motion_test.lua index c5932b661f8b29b33136957f3c88eaf4790b2432..31752f7a46f27df7bf2f91745c8e9b131edb0d5d 100644 --- a/sbroad-cartridge/test_app/test/integration/motion_test.lua +++ b/sbroad-cartridge/test_app/test/integration/motion_test.lua @@ -4,11 +4,10 @@ local g = t.group('integration_api.motion') local helper = require('test.helper.cluster_no_replication') local cluster = nil -g.before_all( - function() +g.before_all(function() + helper.start_test_cluster(helper.cluster_config) cluster = helper.cluster - end -) +end) g.before_each( function() @@ -70,6 +69,10 @@ g.after_each( end ) +g.after_all(function() + helper.stop_test_cluster() +end) + g.test_simple_motion_query = function() local api = cluster:server("api-1").net_box diff --git a/sbroad-cartridge/test_app/test/integration/operators_test.lua b/sbroad-cartridge/test_app/test/integration/operators_test.lua index 2c44bc3e4c49664b9e6612aad267d252f914aa5d..f3ca535441717d9955160efe17857896316feacf 100644 --- a/sbroad-cartridge/test_app/test/integration/operators_test.lua +++ b/sbroad-cartridge/test_app/test/integration/operators_test.lua @@ -4,11 +4,10 @@ local g = t.group('integration_api.operators') local helper = require('test.helper.cluster_no_replication') local cluster = nil -g.before_all( - function() +g.before_all(function() + helper.start_test_cluster(helper.cluster_config) cluster = helper.cluster - end -) +end) g.before_each( function() @@ -82,6 +81,10 @@ g.after_each( end ) +g.after_all(function() + helper.stop_test_cluster() +end) + g.test_not_eq = function() local api = cluster:server("api-1").net_box -- id=1 already in space diff --git a/sbroad-cartridge/test_app/test/configuration/sql_cache_test.lua b/sbroad-cartridge/test_app/test/integration/sql_cache_test.lua similarity index 74% rename from sbroad-cartridge/test_app/test/configuration/sql_cache_test.lua rename to sbroad-cartridge/test_app/test/integration/sql_cache_test.lua index 583999e02315d2518a9becb033c48ef9c3072cd7..954977eb499961493da5712f0871435c4b0e7784 100644 --- a/sbroad-cartridge/test_app/test/configuration/sql_cache_test.lua +++ b/sbroad-cartridge/test_app/test/integration/sql_cache_test.lua @@ -5,25 +5,27 @@ local helper = require('test.helper.cluster_async_replication') local cluster = nil g.before_all( - function() - cluster = helper.cluster + function() + helper.start_test_cluster(helper.cluster_config) + cluster = helper.cluster - local storage1 = cluster:server("storage-1-1").net_box - storage1:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) + local storage1 = cluster:server("storage-1-1").net_box + storage1:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) - local storage2 = cluster:server("storage-2-1").net_box - storage2:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) - end + local storage2 = cluster:server("storage-2-1").net_box + storage2:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) + end ) g.after_all( - function() - local storage1 = cluster:server("storage-1-1").net_box - storage1:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) + function() + local storage1 = cluster:server("storage-1-1").net_box + storage1:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) - local storage2 = cluster:server("storage-2-1").net_box - storage2:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) - end + local storage2 = cluster:server("storage-2-1").net_box + storage2:call("box.execute", { [[truncate table "space_for_breake_cache"]] }) + helper.stop_test_cluster() + end ) g.test_change_cache_by_config_replica = function() diff --git a/sbroad-cartridge/test_app/test/integration/target_queries_test.lua b/sbroad-cartridge/test_app/test/integration/target_queries_test.lua index 7d9ce739d681dbd0d7ff5bf0c0ffc8e51f867463..4c1c70df87e7da4e79ef6c8917742b64d763138e 100644 --- a/sbroad-cartridge/test_app/test/integration/target_queries_test.lua +++ b/sbroad-cartridge/test_app/test/integration/target_queries_test.lua @@ -5,141 +5,144 @@ local helper = require('test.helper.cluster_no_replication') local cluster = nil target_queries.before_all( - function() - cluster = helper.cluster - - local api = cluster:server("api-1").net_box - - local r, err = api:call("sbroad.execute", { - [[insert into "col1_transactions_actual" - ("col1", "amount", "account_id", "sys_from") - values (?, ?, ?, ?), (?, ?, ?, ?)]], - { - 1, 3, 1, 0, - 3, 3, 1, 0 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 2}) - - r, err = api:call("sbroad.execute", { - [[insert into "col1_transactions_history" - ("id", "col1", "amount", "account_id", "sys_from", "sys_to") - values (?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?)]], - { - 1, 1, 2, 1, 0, 2, - 2, 1, 1, 1, 0, 1 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 2}) - - r, err = api:call("sbroad.execute", { - [[insert into "col1_col2_transactions_actual" - ("col1", "col2", "amount", "account_id", "sys_from") - values (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)]], - { - 1, 2, 3, 1, 0, - 1, 1, 3, 1, 0 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 2}) - - r, err = api:call("sbroad.execute", { - [[insert into "col1_col2_transactions_history" - ("id", "col1", "col2", "amount", "account_id", "sys_from", "sys_to") - values (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?)]], - { - 1, 1, 2, 2, 1, 0, 2, - 2, 1, 2, 1, 1, 0, 1 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 2}) - - r = api:call("sbroad.execute", { - [[insert into "cola_accounts_actual" - ("id", "cola", "colb", "sys_from") - values (?, ?, ?, ?), (?, ?, ?, ?)]], - { - 1, 1, 3, 0, - 1, 2, 3, 0 - } - }) - t.assert_equals(r, {row_count = 2}) - - r, err = api:call("sbroad.execute", { - [[insert into "cola_accounts_history" - ("id", "cola", "colb", "sys_from", "sys_to") - values (?, ?, ?, ?, ?)]], - { - 1, 1, 2, 0, 2 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 1}) - - r, err = api:call("sbroad.execute", { - [[insert into "cola_colb_accounts_actual" - ("id", "cola", "colb", "sys_from") - values (?, ?, ?, ?)]], - { - 1, 1, 3, 0 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 1}) - - r, err = api:call("sbroad.execute", { - [[insert into "cola_colb_accounts_history" - ("id", "cola", "colb", "sys_from", "sys_to") - values (?, ?, ?, ?, ?)]], - { - 1, 1, 2, 0, 2 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 1}) - - r, err = api:call("sbroad.execute", { - [[insert into "col1_col2_transactions_num_actual" - ("col1", "col2", "amount", "account_id", "sys_from") - values (?, ?, ?, ?, ?)]], - { - 1, 2, 3, 1, 0 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 1}) - - r, err = api:call("sbroad.execute", { - [[insert into "col1_col2_transactions_num_history" - ("id", "col1", "col2", "amount", "account_id", "sys_from", "sys_to") - values (?, ?, ?, ?, ?, ?, ?)]], - { - 1, 1, 2, 2, 1, 0, 2 - } - }) - t.assert_equals(err, nil) - t.assert_equals(r, {row_count = 1}) - end + function() + helper.start_test_cluster(helper.cluster_config) + cluster = helper.cluster + + local api = cluster:server("api-1").net_box + + local r, err = api:call("sbroad.execute", { + [[insert into "col1_transactions_actual" + ("col1", "amount", "account_id", "sys_from") + values (?, ?, ?, ?), (?, ?, ?, ?)]], + { + 1, 3, 1, 0, + 3, 3, 1, 0 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 2}) + + r, err = api:call("sbroad.execute", { + [[insert into "col1_transactions_history" + ("id", "col1", "amount", "account_id", "sys_from", "sys_to") + values (?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?)]], + { + 1, 1, 2, 1, 0, 2, + 2, 1, 1, 1, 0, 1 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 2}) + + r, err = api:call("sbroad.execute", { + [[insert into "col1_col2_transactions_actual" + ("col1", "col2", "amount", "account_id", "sys_from") + values (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)]], + { + 1, 2, 3, 1, 0, + 1, 1, 3, 1, 0 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 2}) + + r, err = api:call("sbroad.execute", { + [[insert into "col1_col2_transactions_history" + ("id", "col1", "col2", "amount", "account_id", "sys_from", "sys_to") + values (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?)]], + { + 1, 1, 2, 2, 1, 0, 2, + 2, 1, 2, 1, 1, 0, 1 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 2}) + + r = api:call("sbroad.execute", { + [[insert into "cola_accounts_actual" + ("id", "cola", "colb", "sys_from") + values (?, ?, ?, ?), (?, ?, ?, ?)]], + { + 1, 1, 3, 0, + 1, 2, 3, 0 + } + }) + t.assert_equals(r, {row_count = 2}) + + r, err = api:call("sbroad.execute", { + [[insert into "cola_accounts_history" + ("id", "cola", "colb", "sys_from", "sys_to") + values (?, ?, ?, ?, ?)]], + { + 1, 1, 2, 0, 2 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 1}) + + r, err = api:call("sbroad.execute", { + [[insert into "cola_colb_accounts_actual" + ("id", "cola", "colb", "sys_from") + values (?, ?, ?, ?)]], + { + 1, 1, 3, 0 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 1}) + + r, err = api:call("sbroad.execute", { + [[insert into "cola_colb_accounts_history" + ("id", "cola", "colb", "sys_from", "sys_to") + values (?, ?, ?, ?, ?)]], + { + 1, 1, 2, 0, 2 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 1}) + + r, err = api:call("sbroad.execute", { + [[insert into "col1_col2_transactions_num_actual" + ("col1", "col2", "amount", "account_id", "sys_from") + values (?, ?, ?, ?, ?)]], + { + 1, 2, 3, 1, 0 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 1}) + + r, err = api:call("sbroad.execute", { + [[insert into "col1_col2_transactions_num_history" + ("id", "col1", "col2", "amount", "account_id", "sys_from", "sys_to") + values (?, ?, ?, ?, ?, ?, ?)]], + { + 1, 1, 2, 2, 1, 0, 2 + } + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 1}) + end ) target_queries.after_all( - function() - local storage1 = cluster:server("storage-1-1").net_box - storage1:call("box.execute", { [[truncate table "col1_transactions_actual"]] }) - storage1:call("box.execute", { [[truncate table "col1_transactions_history"]] }) - storage1:call("box.execute", { [[truncate table "col1_col2_transactions_actual"]] }) - storage1:call("box.execute", { [[truncate table "col1_col2_transactions_history"]] }) - - local storage2 = cluster:server("storage-2-1").net_box - storage2:call("box.execute", { [[truncate table "col1_transactions_actual"]] }) - storage2:call("box.execute", { [[truncate table "col1_transactions_history"]] }) - storage1:call("box.execute", { [[truncate table "col1_col2_transactions_actual"]] }) - storage1:call("box.execute", { [[truncate table "col1_col2_transactions_history"]] }) - end + function() + local storage1 = cluster:server("storage-1-1").net_box + storage1:call("box.execute", { [[truncate table "col1_transactions_actual"]] }) + storage1:call("box.execute", { [[truncate table "col1_transactions_history"]] }) + storage1:call("box.execute", { [[truncate table "col1_col2_transactions_actual"]] }) + storage1:call("box.execute", { [[truncate table "col1_col2_transactions_history"]] }) + + local storage2 = cluster:server("storage-2-1").net_box + storage2:call("box.execute", { [[truncate table "col1_transactions_actual"]] }) + storage2:call("box.execute", { [[truncate table "col1_transactions_history"]] }) + storage1:call("box.execute", { [[truncate table "col1_col2_transactions_actual"]] }) + storage1:call("box.execute", { [[truncate table "col1_col2_transactions_history"]] }) + + helper.stop_test_cluster() + end ) target_queries.test_type_1 = function() diff --git a/sbroad-cartridge/test_app/test/integration/validate_schema_test.lua b/sbroad-cartridge/test_app/test/integration/validate_schema_test.lua index 1669d7b837351564951d1f0dbc82a48c73e834cf..785c365653938bae1ac077505db24167b86b6a52 100644 --- a/sbroad-cartridge/test_app/test/integration/validate_schema_test.lua +++ b/sbroad-cartridge/test_app/test/integration/validate_schema_test.lua @@ -4,8 +4,6 @@ local helper = require('test.helper.cluster_no_replication') g.before_all( function() - helper.stop_test_cluster() - local cfg = { schema = { spaces = { @@ -67,13 +65,9 @@ g.before_all( end ) -g.after_all( - function() - helper.stop_test_cluster() - - helper.start_test_cluster(helper.cluster_config) - end -) +g.after_all(function() + helper.stop_test_cluster() +end) g.test_schema_invalid = function () local api = helper.cluster:server("api-1").net_box