[Tarantool-patches] [PATCH v2] Split box/hash.test.lua to a set of small independent tests

Konstantin Osipov kostja.osipov at gmail.com
Fri Mar 20 12:20:45 MSK 2020


* Sergey Bronnikov <sergeyb at tarantool.org> [20/03/20 10:10]:
> On 00:31 Fri 20 Mar , Konstantin Osipov wrote:
> > * Sergey Bronnikov <sergeyb at tarantool.org> [20/03/19 13:25]:
> > > Splitted single hash.test.lua to a set of small independent tests.
> >
> > No rationale?
> 
> No, there are.
> Right now the most tarantool tests looks like a huge unstructured pieces
> of code.

> There are no clear boundaries between testcases and it is
> unclear what we want to test exactly, sometimes comments understand
> these boundaries. Often setup/teardown mixed between testcases and
> testcases doesn't make cleanup at the end. It means that tests left
> 'dirty' environment and it may affect next testcases.
> 
> I want to follow pattern AAA (Act-Arrange-Assert) in tarantool tests in
> future and make tests more clear, maintainable and stable. Splitting
> huge tests for an independent testcase is a first step into this
> direction. Perhaps we can split testcases into separate functions, but
> AFAIK test-run.py cannot manage Lua functions as a separate testcases.

This rationale belongs to the commit comment. 

My take is - the rationale is weak. From the outside it looks like
you do not understand this code well enough but try to modify it
to match your expectations. Besides, it is puzzling why you spend
time on it, as if there were no areas in the code that required
testing (transactional data dictionary!). The tests were written by developers 
and serve their purpose quite well. If you feel you would like to
exercise AAA pattern, go ahead and write some new tests - and
make an effort that they are as fast, clean and easy to use as
existing ones. 

-- 
Konstantin Osipov, Moscow, Russia
https://scylladb.com


More information about the Tarantool-patches mailing list