Class cartridge.test-helpers.server
Extended luatest.Server class to run tarantool instance.
Functions
Server:build_env () | Generates environment to run process with. |
Server:start () | Start the server. |
Server:stop () | Stop server process. |
Server:graphql (request[, options]) | Perform GraphQL request on cluster. |
Server:join_cluster (main_server[, options]) | Advertise this server to the cluster. |
Server:setup_replicaset (config) | Update server's replicaset config. |
Server:upload_config (config) | Upload application config. |
Server:download_config () | Download application config. |
Methods
cartridge.test-helpers.server:new (object) | Build server object. |
Functions
- Server:build_env ()
-
Generates environment to run process with.
The result is merged into os.environ().
Returns:
-
map
- Server:start ()
- Start the server.
- Server:stop ()
- Stop server process.
- Server:graphql (request[, options])
-
Perform GraphQL request on cluster.
Parameters:
- request object to be serialized into JSON body.
- options additional options for :http_request. (optional)
Returns:
-
parsed response JSON.
Raises:
HTTPRequest error when request fails or first error fromerrors
field if any. - Server:join_cluster (main_server[, options])
-
Advertise this server to the cluster.
Parameters:
- main_server Server to perform GraphQL request on.
- options
- timeout request timeout
- Server:setup_replicaset (config)
-
Update server's replicaset config.
Parameters:
- config
- uuid replicaset uuid
- roles list of roles
- master
- weight
- config
- Server:upload_config (config)
-
Upload application config.
Parameters:
- Server:download_config ()
- Download application config.
Methods
- cartridge.test-helpers.server:new (object)
-
Build server object.
Parameters:
- object
- command string Command to start server process.
- workdir
string
Value to be passed in
TARANTOOL_WORKDIR
. - chdir bool Path to cwd before starting a process. (optional)
- env tab Table to pass as env variables to process. (optional)
- args tab Args to run command with. (optional)
- http_port
int
Value to be passed in
TARANTOOL_HTTP_PORT
and used to perform HTTP requests. (optional) - advertise_port
int
Value to generate
TARANTOOL_ADVERTISE_URI
and used for net_box connection. - net_box_port
int
Alias for
advertise_port
. (optional) - net_box_credentials tab Override default net_box credentials. (optional)
- alias string Instance alias.
- cluster_cookie
string
Value to be passed in
TARANTOOL_CLUSTER_COOKIE
and used as default net_box password. - instance_uuid string Server identifier. (optional)
- replicaset_uuid string Replicaset identifier. (optional)
Returns:
-
input object
- object