From 130335e43e95403d92edbb840bbcedc8e031fe23 Mon Sep 17 00:00:00 2001
From: Alexander Turenko <alexander.turenko@tarantool.org>
Date: Tue, 22 Aug 2023 19:16:09 +0300
Subject: [PATCH] test: accept env in interactive_tarantool.new()

It is needed to fix a problem in the
`config-luatest/credentials_applier` test. See the next commit.

NO_DOC=It is a testing helper improvement.
NO_CHANGELOG=see NO_DOC
NO_TEST=see NO_DOC
---
 test/interactive_tarantool.lua | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/interactive_tarantool.lua b/test/interactive_tarantool.lua
index bf67654e0f..601e7991b1 100644
--- a/test/interactive_tarantool.lua
+++ b/test/interactive_tarantool.lua
@@ -294,6 +294,7 @@ end
 function M._new_internal(opts)
     local opts = opts or {}
     local args = opts.args or {}
+    local env = opts.env or {}
     local prompt = opts.prompt
 
     local tarantool_exe = arg[-1]
@@ -301,7 +302,7 @@ function M._new_internal(opts)
         stdin = popen.opts.PIPE,
         stdout = popen.opts.PIPE,
         stderr = popen.opts.PIPE,
-        env = {
+        env = fun.chain({
             -- Don't know why, but without defined TERM environment
             -- variable readline doesn't accept INPUTRC environment
             -- variable.
@@ -313,7 +314,7 @@ function M._new_internal(opts)
             -- (because the command in the echo output will be
             -- trimmed).
             INPUTRC = '/dev/null',
-        },
+        }, env):tomap(),
     })
 
     local res = setmetatable({
-- 
GitLab