Skip to content

Commit b5d9279

Browse files
committed
Remove unused pretest_clean.lua script
After the previous commit in the current patchset we don't use the same tarantool server process from test to test and we don't need to use any scripts like 'pretest_clean.lua' to cleanup it between tests. So this patch removes this script.
1 parent 17bee72 commit b5d9279

File tree

3 files changed

+2
-339
lines changed

3 files changed

+2
-339
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,8 @@ The behaviour of this option varies across test suite types (`core = tarantool /
350350
app / unittest`).
351351

352352
For a `core = tarantool` test suite enabling of this option will lead to
353-
execution of a special clean function before each Lua test. The
354-
`pretest_clean.lua` file is copied into a test directory (`var/ddd-suite-name`)
355-
and `require('pretest_clean').clean()` is invoked before each test.
353+
execution of a special clean function `require('pretest_clean').clean()`
354+
before each Lua test.
356355

357356
This function performs the following steps:
358357

lib/tarantool_server.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,6 @@ def write_result_file_version_line(self):
122122
sys.stdout.write(self.RESULT_FILE_VERSION_TEMPLATE.format(
123123
self.result_file_version) + '\n')
124124

125-
def execute_pretest_clean(self, ts):
126-
""" Clean globals, loaded packages, spaces, users, roles
127-
and so on before each test if the option is set.
128-
129-
Return True as success (or if this feature is disabled
130-
in suite.ini) and False in case of an error.
131-
"""
132-
if not self.suite_ini['pretest_clean']:
133-
return True
134-
135-
command = "require('pretest_clean').clean()"
136-
result = self.send_command(command, ts, 'lua')
137-
result = result.replace('\r\n', '\n')
138-
if result != '---\n...\n':
139-
sys.stdout.write(result)
140-
return False
141-
142-
return True
143-
144125
def execute_pragma_sql_default_engine(self, ts):
145126
""" Set default engine for an SQL test if it is provided
146127
in a configuration.
@@ -239,8 +220,6 @@ def flush(self, ts, command_log, command_exe):
239220

240221
def exec_loop(self, ts):
241222
self.write_result_file_version_line()
242-
if not self.execute_pretest_clean(ts):
243-
return
244223
if not self.execute_pragma_sql_default_engine(ts):
245224
return
246225

@@ -789,10 +768,6 @@ def copy_files(self):
789768
shutil.copy(tntctl_file, self.vardir)
790769
shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'),
791770
self.vardir)
792-
# Need to use get here because of nondefault servers doesn't have ini.
793-
if self.ini.get('pretest_clean', False):
794-
shutil.copy(os.path.join(self.TEST_RUN_DIR, 'pretest_clean.lua'),
795-
self.vardir)
796771

797772
if self.snapshot_path:
798773
# Copy snapshot to the workdir.

pretest_clean.lua

Lines changed: 0 additions & 311 deletions
This file was deleted.

0 commit comments

Comments
 (0)