-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated PHPUnit to version 7 + gh-24 + gh-42 + gh-85 + gh-83 + gh-71 #134
Changes from 4 commits
108b658
e93c8ed
e50e288
35daa0a
bf6ef57
13d2653
4567e20
6453c4b
dd8b8fe
5546eae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ Makefile.in | |
/config.nice | ||
/config.status | ||
/config.sub | ||
/configure.ac | ||
/configure.in | ||
/libtool | ||
/ltmain.sh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,32 +95,35 @@ def execute_no_reconnect(self, command): | |
if not command: | ||
return | ||
cmd = command.replace('\n', ' ') + '\n' | ||
self.socket.sendall(cmd) | ||
self.socket.sendall(cmd.encode()) | ||
|
||
bufsiz = 4096 | ||
res = "" | ||
res = b'' | ||
|
||
while True: | ||
buf = self.socket.recv(bufsiz) | ||
if not buf: | ||
break | ||
res = res + buf | ||
if (res.rfind("\n...\n") >= 0 or res.rfind("\r\n...\r\n") >= 0): | ||
if (res.rfind(b'\n...\n') >= 0 or res.rfind(b'\r\n...\r\n') >= 0): | ||
break | ||
|
||
return yaml.load(res) | ||
|
||
class TarantoolServer(object): | ||
default_tarantool = { | ||
"bin": "tarantool", | ||
"logfile": "tarantool.log", | ||
"init": "init.lua"} | ||
"bin": "tarantool", | ||
"logfile": "tarantool.log", | ||
"init": "init.lua", | ||
"unix": "tarantool.sock" | ||
} | ||
|
||
default_cfg = { | ||
"custom_proc_title": "\"tarantool-python testing\"", | ||
"slab_alloc_arena": 0.5, | ||
"pid_file": "\"box.pid\"", | ||
"rows_per_wal": 200} | ||
"custom_proc_title": "\"tarantool-python testing\"", | ||
"slab_alloc_arena": 0.5, | ||
"pid_file": "\"box.pid\"", | ||
"rows_per_wal": 200 | ||
} | ||
|
||
@property | ||
def logfile_path(self): | ||
|
@@ -134,6 +137,10 @@ def cfgfile_path(self): | |
def script_path(self): | ||
return os.path.join(self.vardir, self.default_tarantool['init']) | ||
|
||
@property | ||
def unix_path(self): | ||
return os.path.join(self.vardir, self.default_tarantool['unix']) | ||
|
||
@property | ||
def script_dst(self): | ||
return os.path.join(self.vardir, os.path.basename(self.script)) | ||
|
@@ -187,9 +194,9 @@ def log_des(self): | |
def __init__(self): | ||
os.popen('ulimit -c unlimited') | ||
self.args = {} | ||
self.args['primary'] = find_port() | ||
self.args['admin'] = find_port(self.args['primary'] + 1) | ||
self._admin = self.args['admin'] | ||
|
||
self.use_unix = False | ||
|
||
self.vardir = tempfile.mkdtemp(prefix='var_', dir=os.getcwd()) | ||
self.find_exe() | ||
|
||
|
@@ -204,6 +211,7 @@ def find_exe(self): | |
raise RuntimeError("Can't find server executable in " + os.environ["PATH"]) | ||
|
||
def generate_configuration(self): | ||
# print(self.args) | ||
os.putenv("PRIMARY_PORT", str(self.args['primary'])) | ||
os.putenv("ADMIN_PORT", str(self.args['admin'])) | ||
|
||
|
@@ -242,10 +250,18 @@ def start(self): | |
# start Tarantool\Box --DONE(prepare_args) | ||
# * Wait unitl Tarantool\Box | ||
# started --DONE(wait_until_started) | ||
if self.use_unix: | ||
self.args['primary'] = self.unix_path | ||
self.args['admin'] = find_port() | ||
else: | ||
self.args['primary'] = find_port() | ||
self.args['admin'] = find_port(self.args['primary'] + 1) | ||
self._admin = self.args['admin'] | ||
|
||
self.generate_configuration() | ||
if self.script: | ||
shutil.copy(self.script, self.script_dst) | ||
os.chmod(self.script_dst, 0777) | ||
os.chmod(self.script_dst, 511) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is better to use |
||
args = self.prepare_args() | ||
self.process = subprocess.Popen(args, | ||
cwd = self.vardir, | ||
|
@@ -268,5 +284,4 @@ def clean(self): | |
|
||
def __del__(self): | ||
self.stop() | ||
self.clean() | ||
|
||
# self.clean() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you comment clean here? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,18 +95,16 @@ ZEND_EXTERN_MODULE_GLOBALS(tarantool); | |
|
||
typedef struct tarantool_object { | ||
struct tarantool_connection { | ||
char *host; | ||
int port; | ||
char *login; | ||
char *passwd; | ||
char *url; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it wroth to comment purpose of
|
||
struct tarantool_url *url_parsed; | ||
php_stream *stream; | ||
struct tarantool_schema *schema; | ||
smart_string *value; | ||
struct tp *tps; | ||
char *greeting; | ||
char *salt; | ||
/* Only for persistent connections */ | ||
char *orig_login; | ||
char *orig_user; | ||
char *suffix; | ||
int suffix_len; | ||
zend_string *persistent_id; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten debug print.