Skip to content

Commit 59aa1a3

Browse files
committed
test: Allow use environment variable TARANTOOL_BIN
Environment variable TARANTOOL_BIN can be used to specify path of Tarantool executable.
1 parent 44ff22e commit 59aa1a3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test_helpers/main.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,20 @@ func atoiUint64(str string) (uint64, error) {
120120
return res, nil
121121
}
122122

123+
func getTarantoolExec() string {
124+
if tar_bin := os.Getenv("TARANTOOL_BIN"); tar_bin != "" {
125+
return tar_bin
126+
}
127+
return "tarantool"
128+
}
129+
123130
// IsTarantoolVersionLess checks if tarantool version is less
124131
// than passed <major.minor.patch>. Returns error if failed
125132
// to extract version.
126133
func IsTarantoolVersionLess(majorMin uint64, minorMin uint64, patchMin uint64) (bool, error) {
127134
var major, minor, patch uint64
128135

129-
out, err := exec.Command("tarantool", "--version").Output()
136+
out, err := exec.Command(getTarantoolExec(), "--version").Output()
130137

131138
if err != nil {
132139
return true, err
@@ -203,7 +210,7 @@ func StartTarantool(startOpts StartOpts) (TarantoolInstance, error) {
203210
}
204211
}
205212

206-
inst.Cmd = exec.Command("tarantool", startOpts.InitScript)
213+
inst.Cmd = exec.Command(getTarantoolExec(), startOpts.InitScript)
207214

208215
inst.Cmd.Env = append(
209216
os.Environ(),

0 commit comments

Comments
 (0)