Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
d92b98b3
Commit
d92b98b3
authored
9 years ago
by
bigbes
Browse files
Options
Downloads
Patches
Plain Diff
Add running tests against configured/running tarantool. closes gh-302
parent
095f6d1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/lib/tarantool_server.py
+16
-4
16 additions, 4 deletions
test/lib/tarantool_server.py
with
16 additions
and
4 deletions
test/lib/tarantool_server.py
+
16
−
4
View file @
d92b98b3
...
...
@@ -363,7 +363,8 @@ class TarantoolServer(Server):
'
lua_libs
'
:
[],
'
valgrind
'
:
False
,
'
vardir
'
:
None
,
'
use_unix_sockets
'
:
False
'
use_unix_sockets
'
:
False
,
'
tarantool_port
'
:
None
}
ini
.
update
(
_ini
)
Server
.
__init__
(
self
,
ini
)
...
...
@@ -383,7 +384,7 @@ class TarantoolServer(Server):
self
.
lua_libs
=
ini
[
'
lua_libs
'
]
self
.
valgrind
=
ini
[
'
valgrind
'
]
self
.
use_unix_sockets
=
ini
[
'
use_unix_sockets
'
]
#
self._start_against_running = ini['tarantool_port']
self
.
_start_against_running
=
ini
[
'
tarantool_port
'
]
def
__del__
(
self
):
self
.
stop
()
...
...
@@ -405,6 +406,11 @@ class TarantoolServer(Server):
raise
RuntimeError
(
"
Can
'
t find server executable in
"
+
path
)
def
install
(
self
,
silent
=
True
):
if
self
.
_start_against_running
:
self
.
_sql
=
self
.
_start_against_running
self
.
_admin
=
int
(
self
.
_start_against_running
)
+
1
return
if
not
silent
:
color_stdout
(
'
Installing the server ...
\n
'
,
schema
=
'
serv_text
'
)
color_stdout
(
'
Found executable at
'
,
schema
=
'
serv_text
'
)
...
...
@@ -444,6 +450,8 @@ class TarantoolServer(Server):
return
shlex
.
split
(
self
.
script_dst
if
self
.
script
else
self
.
binary
)
def
start
(
self
,
silent
=
True
,
wait
=
True
):
if
self
.
_start_against_running
:
return
if
self
.
status
==
'
started
'
:
if
not
silent
:
color_stdout
(
'
The server is already started.
\n
'
,
schema
=
'
lerror
'
)
...
...
@@ -474,6 +482,8 @@ class TarantoolServer(Server):
self
.
process
.
wait
()
def
stop
(
self
,
silent
=
True
):
if
self
.
_start_against_running
:
return
if
self
.
status
!=
'
started
'
:
if
not
silent
:
color_stdout
(
'
The server is not started.
\n
'
,
schema
=
'
lerror
'
)
...
...
@@ -550,8 +560,10 @@ class TarantoolServer(Server):
def
print_log
(
self
,
lines
):
color_stdout
(
"
\n
Last {0} lines of Tarantool Log file:
\n
"
.
format
(
lines
),
schema
=
'
error
'
)
with
open
(
self
.
logfile
,
'
r
'
)
as
log
:
return
log
.
readlines
()[
-
lines
:]
if
os
.
path
.
exists
(
self
.
logfile
):
with
open
(
self
.
logfile
,
'
r
'
)
as
log
:
return
log
.
readlines
()[
-
lines
:]
color_stdout
(
"
Can
'
t find log:
\n
"
,
schema
=
'
error
'
)
def
test_option_get
(
self
,
option_list_str
,
silent
=
False
):
args
=
[
self
.
binary
]
+
shlex
.
split
(
option_list_str
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment