test: almost entirely refactor pytest
In conftest.py
:
-
Add function
xdist_worker_number
. It convertsstr(worker_id)
intoint
. It serves as a substitute forsession_data_mutex
for parallel test runs. -
Change
normalize_net_box_result
. Replace a function with a decorator. Also, handle typical kinds of picodata responses. Extensively test it intest_basics.py::test_eval/call_normalization
. -
Add dataclass
RaftStatus
. It shouldn't be used outsideconftest.py
. It only makes assertions more brief in logs and understndable in code. -
Add all raft stuff into the
Instance
class. This impliesraft_propose_eval
,assert_raft_status
allpromote_or_fail
moved fromutil.py
. -
Change fixture
compile
. No need in extra logics since commit 59c31cb8. -
Preserve fixture
binary_path
. -
Remove fixtures
session_data_mutex
andrun_id
. Superseded withxdist_worker_number
. -
Remove fixtures
run_cluster
andrun_instance
. Superseded withcluster.deploy(...)
. -
Remove function
wait_tcp_port
. It's never enough to check raw socket. Superseded withinstance.wait_ready()
.
In test_basics.py
:
-
Add
test_xdist_worker_number
. -
Add
test_call_normalization
andtest_eval_normalization
. -
Add
test_process_management
. It's brand new, never implemented in luatest before. -
Rename
test_single_instance_raft_eval
totest_propose_eval
and extend it with additional assertion fromsingle_test.lua
. -
Remove
test_instance
. A part of its logics is moved totest_call/eval_normalization
. The other part is rewritten and extended intest_process_management
. -
Remove
test_cluster
. It was completely useless because of inappropriate synchronization and no valuable assertions. -
Remove
test_propose_eval
. It wasn't that useful, but failed because of inappropriate synchronization.
In test_couple.py
:
-
Preserve
test_follower_proposal
andtest_failover
. Just slightly refactor according to the newconftest.py
API.
In util.py
(completely removed):
-
Remove decorator
retry
. Needless. -
Remove decorator
retry_on_network_errors
. Inappropriate predicate didn't catch Lua errors. -
Remove everything related to raft. Move it into
conftest.py
.
Part of #59 (closed)