Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos
Commits
a0aa60de
Commit
a0aa60de
authored
Feb 09, 2016
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use by default SQLite.
Do not yet run ZODB tests. Clean up previous runs.
parent
fb66da0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
software/neoppod/runTestSuite.in
software/neoppod/runTestSuite.in
+27
-8
No files found.
software/neoppod/runTestSuite.in
View file @
a0aa60de
...
...
@@ -2,7 +2,7 @@
"""
Script to run NEO test suite using Nexedi's test node framework.
"""
import argparse, sys, subprocess, os
import argparse, sys, subprocess, os
, glob
import traceback
from erp5.util import taskdistribution
import re
...
...
@@ -15,9 +15,22 @@ SUMMARY_RE = re.compile( \
# NEO specific environment
TEMP_DIRECTORY = '{{neo_temp_directory}}/neotest_tmp'
MYSQL_UNIX_PORT = '{{my_cnf_parameters.socket}}'
NEO_TESTS_ADAPTER = '
MySQL' # XXX: we can have SQLite as well!
NEO_TESTS_ADAPTER = '
SQLite'
RUN_NEO_TESTS_COMMAND = '{{ neotestrunner }}'
def cleanup():
"""
Clean up from previous runs.
"""
for root, dirs, files in os.walk(TEMP_DIRECTORY, topdown=False):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))
if NEO_TESTS_ADAPTER == 'MySQL':
# XXX: remove MySQL
pass
def parseTestStdOut(data):
"""
Parse output of NEO testrunner script.
...
...
@@ -82,14 +95,19 @@ def main():
test_title = test_suite_title,
project_title = args.project_title)
if test_result is not None:
# clean up previous runs
cleanup()
# run NEO tests
test_result_line = test_result.start()
command = "%s -ufz" %RUN_NEO_TESTS_COMMAND
args = [RUN_NEO_TESTS_COMMAND, '-ufz']
# XXX: add '-z' - i.e. ZODB tests when find out why it stalled execution.
args = [RUN_NEO_TESTS_COMMAND, '-ufv']
command = ' '.join(args)
stdin = file(os.devnull)
env = {'TEMP': TEMP_DIRECTORY,
'MYSQL_UNIX_PORT': MYSQL_UNIX_PORT,
'NEO_TESTS_ADAPTER': NEO_TESTS_ADAPTER}
if NEO_TESTS_ADAPTER == 'MySQL':
env['MYSQL_UNIX_PORT'] = MYSQL_UNIX_PORT
try:
p = subprocess.Popen(args, stdin=stdin, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, env=env)
...
...
@@ -103,9 +121,10 @@ def main():
raise EnvironmentError(result)
# parse test stdout / stderr, hint to speed up use files first!
data
= p.stdout.read()
test_count, error_count, expected_count, skip_count, duration = parseTestStdOut(
data
)
stdout
= p.stdout.read()
test_count, error_count, expected_count, skip_count, duration = parseTestStdOut(
stdout
)
print test_result_line
print stdout
# report status back to Nexedi ERP5
test_result_line.stop(
...
...
@@ -116,7 +135,7 @@ def main():
duration = duration,
date = None, # XXX: date when test run or when finished ?
command = command,
stdout=
data
,
stdout=
stdout
,
stderr='stderr', # XXX:catch it
html_test_result='')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment