Commit 7ec293eb authored by Julien Muchembled's avatar Julien Muchembled Committed by Łukasz Nowak

NEO: full support for PyPy & PyMySQL

parent f69dc56e
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[instance-common] [instance-common]
filename = instance-common.cfg.in filename = instance-common.cfg.in
md5sum = 402d09fbe2927f4f744ad6c0dc4329b9 md5sum = e000e7134113b9d1c63d40861eaf0489
[root-common] [root-common]
filename = root-common.cfg.in filename = root-common.cfg.in
...@@ -30,7 +30,7 @@ md5sum = 9f27195d770b2f57461c60a82c851ab9 ...@@ -30,7 +30,7 @@ md5sum = 9f27195d770b2f57461c60a82c851ab9
[instance-neo] [instance-neo]
filename = instance-neo.cfg.in filename = instance-neo.cfg.in
md5sum = 03a6c72619b02f5100fa7ccc8dc0e5ea md5sum = 504b021715566e69ad664101f1b12a5c
[template-neo-my-cnf] [template-neo-my-cnf]
filename = my.cnf.in filename = my.cnf.in
...@@ -46,4 +46,4 @@ md5sum = 5afd326de385563b5aeac81039f23341 ...@@ -46,4 +46,4 @@ md5sum = 5afd326de385563b5aeac81039f23341
[runTestSuite.in] [runTestSuite.in]
_update_hash_filename_ = runTestSuite.in _update_hash_filename_ = runTestSuite.in
md5sum = 4e7f5b5230800a65c71310a518225119 md5sum = 1e2126d02f54daaa624cefeea004c2da
...@@ -48,6 +48,3 @@ extra-context = ...@@ -48,6 +48,3 @@ extra-context =
raw template_mysqld_wrapper {{ template_mysqld_wrapper }} raw template_mysqld_wrapper {{ template_mysqld_wrapper }}
raw template_neo_my_cnf {{ template_neo_my_cnf }} raw template_neo_my_cnf {{ template_neo_my_cnf }}
{%- endif %} {%- endif %}
{%- if pypy_location is defined %}
raw pypy_location {{ pypy_location }}
{%- endif %}
...@@ -122,6 +122,10 @@ ...@@ -122,6 +122,10 @@
"description": "Size of private tmpfs mount to store the database. See filesystems/tmpfs.txt in Linux documentation. Use only for testing.", "description": "Size of private tmpfs mount to store the database. See filesystems/tmpfs.txt in Linux documentation. Use only for testing.",
"type": "string" "type": "string"
}, },
"test-binding-list": {
"description": "List of bindings to test when running the test suite.",
"type": "array"
},
"mysql": { "mysql": {
"description": "Dictionary containing parameters for MySQL.", "description": "Dictionary containing parameters for MySQL.",
"default": {}, "default": {},
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% set private_tmpfs = slapparameter_dict.get('private-tmpfs') -%} {% set private_tmpfs = slapparameter_dict.get('private-tmpfs') -%}
{% set storage_type = slapparameter_dict.get('storage-type') or ( {% set storage_type = slapparameter_dict.get('storage-type') or (
'MySQL' if mariadb_location is defined else 'SQLite') -%} 'MySQL' if mariadb_location is defined else 'SQLite') -%}
{% set mysql = storage_type == 'MySQL' -%} {% set mysql = storage_type != 'SQLite' -%}
{% if mysql -%} {% if mysql -%}
[{{ section('mysqld') }}] [{{ section('mysqld') }}]
...@@ -167,6 +167,14 @@ post = ${binary-wrap-mysql:command-line} -e "FLUSH LOGS" ...@@ -167,6 +167,14 @@ post = ${binary-wrap-mysql:command-line} -e "FLUSH LOGS"
{% if runTestSuite_in is defined -%} {% if runTestSuite_in is defined -%}
# bin/runTestSuite to run NEO tests # bin/runTestSuite to run NEO tests
[runTestSuite-parameters]
bin_directory = {{ bin_directory }}
prepend_path = {{ mariadb_location }}/bin
test_binding_list = {{ dumps(slapparameter_dict.get('test-binding-list', (
'MySQLdb', 'PyMySQL', 'SQLite',
))) }}
[{{ section('runTestSuite') }}] [{{ section('runTestSuite') }}]
{%- if private_tmpfs %} {%- if private_tmpfs %}
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -182,11 +190,7 @@ url = {{ runTestSuite_in }} ...@@ -182,11 +190,7 @@ url = {{ runTestSuite_in }}
context = context =
section directory directory section directory directory
section my_cnf_parameters my-cnf-parameters section my_cnf_parameters my-cnf-parameters
raw bin_directory {{ bin_directory }} section parameters runTestSuite-parameters
raw prepend_path {{ mariadb_location }}/bin
{%- if pypy_location is defined %}
raw pypy_location {{ pypy_location }}/bin/pypy
{%- endif %}
{%- if private_tmpfs %} {%- if private_tmpfs %}
key datadir my-cnf-parameters:data-directory key datadir my-cnf-parameters:data-directory
key results_directory directory:results key results_directory directory:results
......
#!{{ bin_directory }}/runTestSuite_py #!{{ parameters.bin_directory }}/runTestSuite_py
""" """
Script to run NEO test suite using Nexedi's test node framework. Script to run NEO test suite using Nexedi's test node framework.
""" """
...@@ -13,12 +13,12 @@ SUMMARY_RE = re.compile( ...@@ -13,12 +13,12 @@ SUMMARY_RE = re.compile(
r' (.*) (?P<duration>\d+(\.\d*)?|\.\d+)s', re.MULTILINE) r' (.*) (?P<duration>\d+(\.\d*)?|\.\d+)s', re.MULTILINE)
PATH = os.environ['PATH'] PATH = os.environ['PATH']
PATH = {{ repr(prepend_path) }} + (PATH and ':' + PATH) PATH = {{ repr(parameters.prepend_path) }} + (PATH and ':' + PATH)
# NEO specific environment # NEO specific environment
TEMP_DIRECTORY = {{ repr(directory.tmp) }} TEMP_DIRECTORY = {{ repr(directory.tmp) }}
NEO_DB_SOCKET = {{ repr(my_cnf_parameters.socket) }} NEO_DB_SOCKET = {{ repr(my_cnf_parameters.socket) }}
RUN_NEO_TESTS_COMMAND = {{ repr(bin_directory + '/neotestrunner') }} RUN_NEO_TESTS_COMMAND = {{ repr(parameters.bin_directory + '/neotestrunner') }}
def parseTestStdOut(data): def parseTestStdOut(data):
""" """
...@@ -90,7 +90,7 @@ def main(): ...@@ -90,7 +90,7 @@ def main():
test_suite_title = args.test_suite_title or args.test_suite test_suite_title = args.test_suite_title or args.test_suite
test_name_list = 'SQLite', 'MySQL' test_name_list = {{ repr(parameters.test_binding_list) }}
if args.master_url: if args.master_url:
tool = taskdistribution.TaskDistributor(portal_url = args.master_url) tool = taskdistribution.TaskDistributor(portal_url = args.master_url)
...@@ -115,24 +115,15 @@ def main(): ...@@ -115,24 +115,15 @@ def main():
shutil.rmtree(temp) shutil.rmtree(temp)
os.mkdir(temp) os.mkdir(temp)
args = [RUN_NEO_TESTS_COMMAND, args = [RUN_NEO_TESTS_COMMAND, '-ufz']
{%- if pypy_location is defined -%}
'-fz'
{%- else -%}
'-ufz'
{%- endif -%}
]
command = ' '.join(args) command = ' '.join(args)
env = {'PATH': PATH, env = {'PATH': PATH,
'TEMP': temp, 'TEMP': temp,
{%- if pypy_location is defined %}
'NEO_PYPY': {{ repr(pypy_location) }},
{%- endif %}
'NEO_TESTS_ADAPTER': adapter, 'NEO_TESTS_ADAPTER': adapter,
'NEO_TEST_ZODB_FUNCTIONAL': '1', 'NEO_TEST_ZODB_FUNCTIONAL': '1',
'NEO_DB_USER': 'root'} 'NEO_DB_USER': 'root'}
try: try:
if adapter == 'MySQL': if adapter != 'SQLite':
env['NEO_DB_SOCKET'] = NEO_DB_SOCKET env['NEO_DB_SOCKET'] = NEO_DB_SOCKET
timeout = time() + 60 timeout = time() + 60
while not os.path.exists(NEO_DB_SOCKET): while not os.path.exists(NEO_DB_SOCKET):
......
...@@ -57,7 +57,9 @@ eggs = neoppod[admin, ctl, master] ...@@ -57,7 +57,9 @@ eggs = neoppod[admin, ctl, master]
zope.testing zope.testing
coverage coverage
setproctitle setproctitle
adapter-egg = ${python-mysqlclient:egg} adapter-egg =
${python-mysqlclient:egg}
PyMySQL
[download-base-neo] [download-base-neo]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
...@@ -128,6 +130,7 @@ inline = ...@@ -128,6 +130,7 @@ inline =
coverage = 5.5 coverage = 5.5
ecdsa = 0.13 ecdsa = 0.13
mysqlclient = 1.3.12 mysqlclient = 1.3.12
PyMySQL = 0.10.1
pycrypto = 2.6.1 pycrypto = 2.6.1
cython-zstd = 0.2 cython-zstd = 0.2
funcsigs = 1.0.2 funcsigs = 1.0.2
......
...@@ -3,6 +3,5 @@ extends = ...@@ -3,6 +3,5 @@ extends =
../../component/pypy/buildout.cfg ../../component/pypy/buildout.cfg
software.cfg software.cfg
[instance-common] [python]
context += part = pypy2
key pypy_location pypy2:location
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment