Commit 0d29de33 authored by Julien Muchembled's avatar Julien Muchembled

NEO: full support for PyPy & PyMySQL

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