Module luatest.justrun | Tarantool
Reference Rocks reference Luatest Module luatest.justrun

Module luatest.justrun

Simple Tarantool runner and output catcher.

Sometimes it is necessary to run tarantool with particular arguments and verify its output. luatest.server provides a supervisor like interface: an instance is started, calls box.cfg() and we can communicate with it using net.box. Another helper in tarantool/tarantool, test.interactive_tarantool , aims to solve all the problems around readline console and also provides ability to communicate with the instance interactively.

However, there is nothing like ‘just run tarantool with given args and give me its output’.

Run tarantool in given directory with given environment and command line arguments and catch its output.

Expects JSON lines as the output and parses it into an array (it can be disabled using nojson option).

Options:

  • nojson (boolean, default: false)

Don’t attempt to decode stdout as a stream of JSON lines, return as is.

  • stderr (boolean, default: false)

Collect stderr and place it into the stderr field of the return value

  • quote_args (boolean, default: false)

Quote CLI arguments before concatenating them into a shell command.

Parameters:

  • dir: (string) Directory where the process will run.
  • env: (table) Environment variables for the process.
  • args: (table) Options that will be passed when the process starts.
  • opts: (table) Custom options: nojson, stderr and quote_args. (optional)

Returns:

(table)

Found what you were looking for?
Feedback