Skip to content

Commit

Permalink
test: fix enabling dev_checks
Browse files Browse the repository at this point in the history
Before this patch, running all test suites resulted in running them
with dev_checks disabled since performance tests disabled the globally
on require (and never enabled them back).
  • Loading branch information
DifferentialOrange committed Mar 31, 2023
1 parent 57bcf8d commit a8e8bb3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/performance/perf_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ local t = require('luatest')
local g = t.group('perf')

local helpers = require('test.helper')
helpers.disable_dev_checks()


local id = 0
Expand All @@ -24,6 +23,15 @@ local function reset_gen()
end

g.before_all(function(g)
-- Run real perf tests only with flag, otherwise run short version
-- to test compatibility as part of unit/integration test run.
g.perf_mode_on = os.getenv('PERF_MODE_ON')

if g.perf_mode_on then
g.old_dev_checks_value = os.getenv('TARANTOOL_CRUD_ENABLE_INTERNAL_CHECKS')
helpers.disable_dev_checks()
end

g.cluster = helpers.Cluster:new({
datadir = fio.tempdir(),
server_command = helpers.entrypoint('srv_ddl'),
Expand Down Expand Up @@ -74,10 +82,6 @@ g.before_all(function(g)
rawset(_G, 'crud', require('crud'))
]])

-- Run real perf tests only with flag, otherwise run short version
-- to test compatibility as part of unit/integration test run.
g.perf_mode_on = os.getenv('PERF_MODE_ON')

g.total_report = {}
end)

Expand Down Expand Up @@ -301,6 +305,10 @@ g.after_all(function(g)
row_name.insert_many,
},
})

if g.perf_mode_on then
os.setenv('TARANTOOL_CRUD_ENABLE_INTERNAL_CHECKS', g.old_dev_checks_value)
end
end)

local function generate_customer()
Expand Down

0 comments on commit a8e8bb3

Please sign in to comment.