[tarantool-patches] Re: [PATCH v1] test: switch on pretest_clean routine

Alexander Turenko alexander.turenko at tarantool.org
Sun Apr 7 10:08:24 MSK 2019


Removed the flag from python tests and unit tests (it does not do
anything in these cases, see the description in test-run/README.md).

There was review [1] and it seems some comments are still actual.
However I tried to implement that myself and was dissatisfied with the
result, because of the following reasons:

- much code of tests moves around w/o visible reasons;
- this way disallows usage of functions from an instance file in tests
  w/o, again, visible reasons; it obligates a developer to have a
  separate file for helper functions to reuse them across tests or copy
  them to each test (and they will reside in result files also).

So I decided to implement user-provided list of protected globals [2]
and use it here.

Described how the option works in the commit message and mentioned that
the issue has an example of a problem that is beat with this option.

Pushed to master and 2.1.

[1]: https://www.freelists.org/post/tarantool-patches/test-switched-on-pretest-clean-routine,1
[2]: https://github.com/tarantool/test-run/pull/153

WBR, Alexander Turenko.

On Thu, Apr 04, 2019 at 09:11:01AM +0300, avtikhon wrote:
> Flag 'pretest_clean = True' at the suite.ini file switches on
> pretest_clean routine at the 'test-run' which helps to cleanup
> the test environment before test start. This option that do
> exactly what sqltester had been doing: when the option enabled
> test-run removes *.{xlog,snap} files before run a 'core = app'
> test. The only difference that now these files will be removed
> for every test in sql-tap test suite, not only for ones that
> use sqltester. Also it removes the global functions in box suite
> before each test, that is why they were moved at the test_helpers
> module.
> ---
> 
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-3863-pretest-clean
> Issue: https://github.com/tarantool/tarantool/issues/4094




More information about the Tarantool-patches mailing list