Skip to content

Commit

Permalink
Fix conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ylobankov committed Sep 5, 2023
1 parent bf913e9 commit afc702f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions luatest/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ function Server:initialize()
self.http_client = http_client.new()
end

if self.net_box_uri == nil and self.net_box_port == nil then
self.net_box_uri = self.build_listen_uri(self.alias, self.rs_id or self.id)
end
if self.net_box_uri == nil and self.net_box_port then
self.net_box_uri = 'localhost:' .. self.net_box_port
if self.net_box_uri == nil then
if self.net_box_port == nil then
self.net_box_uri = self.build_listen_uri(self.alias, self.rs_id or self.id)
else
self.net_box_uri = 'localhost:' .. self.net_box_port
end
end

self.env = utils.merge(self.env or {}, self:build_env())
Expand Down Expand Up @@ -191,8 +192,10 @@ function Server:initialize()
self.tests = {}
end

local prefix = fio.pathjoin(Server.vardir, 'artifacts', self.rs_id or '')
self.artifacts = fio.pathjoin(prefix, self.id)
if not self.artifacts then
local prefix = fio.pathjoin(Server.vardir, 'artifacts', self.rs_id or '')
self.artifacts = fio.pathjoin(prefix, self.id)
end
end

-- Create a table with env variables based on the constructor params.
Expand Down

0 comments on commit afc702f

Please sign in to comment.