tarantool / tarantool/tt

Provide an engine for testing applications using Lua

Open
#742 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

18sp feature teamE
Dominant language
Go
Stars
113
Forks
18
Avg merge
4d 11h
Merged PRs (30d)
23

Description

A testing engine might simplify testing of multi-instance applications for Tarantool 3.0. Suppose, we have the following application containing 3 instances and a manually assigned master:

https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/replication/instances.enabled/manual_leader

The process of creating and running tests might for this app might look as follows:

  1. Add a testing dependency (luatest ?) to a *.rockspec file or install the testing dependency using tt rocks install.

  2. Create the test directory inside instances_enabled/manual_leader.

  3. Inside the test directory, create the manual_leader_test.lua file containing app tests.
    This file might look smth like this:

-- manual_leader_test.lua --
-- 'test_application' provides the ability to run the cluster 
-- in a default environment or start only specific instances.
-- The API for testing might mimic tt commands and net.box API.

local test_application = require('luatest.application')
test_application.start([optional_list_of_instances])
local conn001 = test_application.connect(instance001)
local instance001_ro_mode = conn001.box.info.ro
assert_equals(instance001_ro_mode, 'false')

As an idea, the test directory can also contain a custom cluster configuration used for testing.
This config might override some settings from the main config.

  1. Run tests using the tt test manual_leader command.

The idea is taken from the testing engine provided by the Ktor HTTP framework: https://ktor.io/docs/testing.html.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the manual_leader application example at doc/code_snippets/snippets/replication/instances.enabled/manual_leader and the proposed luatest.application API in the issue. Compare the requested workflow with the existing tt test command and Tarantool application management behavior. Done means defining and implementing an agreed testing-engine design for multi-instance applications, including test execution and optional configuration overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, lua
Domain
cli, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.