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
Boxiang Sun
slapos
Commits
f5784f81
Commit
f5784f81
authored
Dec 31, 2018
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust the cython_test sr for multicore testing
parent
ec4ee59a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
26 deletions
+46
-26
software/cython_test/buildout.hash.cfg
software/cython_test/buildout.hash.cfg
+1
-1
software/cython_test/runTestSuite.in
software/cython_test/runTestSuite.in
+43
-25
software/cython_test/software.cfg
software/cython_test/software.cfg
+2
-0
No files found.
software/cython_test/buildout.hash.cfg
View file @
f5784f81
...
@@ -19,4 +19,4 @@ md5sum = 21e0f69f6d89f60d5a00acf8e059dffa
...
@@ -19,4 +19,4 @@ md5sum = 21e0f69f6d89f60d5a00acf8e059dffa
[template-runTestSuite]
[template-runTestSuite]
filename = runTestSuite.in
filename = runTestSuite.in
md5sum =
7d93038e1c7ed3944acc016530a1b738
md5sum =
ce3f257965a8e52b585eca5bb974064b
software/cython_test/runTestSuite.in
View file @
f5784f81
...
@@ -8,6 +8,8 @@ import argparse, os, re, shutil, subprocess, sys, traceback
...
@@ -8,6 +8,8 @@ import argparse, os, re, shutil, subprocess, sys, traceback
from erp5.util import taskdistribution
from erp5.util import taskdistribution
from time import gmtime, strftime
from time import gmtime, strftime
from subprocess import check_output
from subprocess import check_output
import importlib
import datetime
def main():
def main():
parser = argparse.ArgumentParser(description='Run a test suite.')
parser = argparse.ArgumentParser(description='Run a test suite.')
...
@@ -39,29 +41,46 @@ def main():
...
@@ -39,29 +41,46 @@ def main():
##########################
##########################
# Run all tests
# Run all tests
##########################
##########################
# run 'python3 test.py build_ext --inplace'
path_var = os.pathsep.join([os.environ.get('PATH', os.defpath), '${python3.5:location}/bin/python3/bin/'])
# run 'python3 -c 'import test''
env = dict(os.environ, PATH=path_var)
# passed if we get 'done'
# ${python3.5:location}/bin/python3
test_list = ['basic_test', 'lwan_coro_test']
result_string = check_output(['${python3.5:location}/bin/python3 -c "import test"'],
shell=True,
failed = 0
cwd='${cython_nogil:location}',
result_string = None
env={'CI': 'true'})
duration = 0
# result_dict = json.loads(result_string)
test_line_dict = {}
result_failed = 0 if '2.732' in result_string else 1
for test_name in test_list:
# for result in result_dict['tests']:
failed = 0
test_line_dict['%s: %s' % ('Cython test', 'nogil extension initialization')] = {
result_string = None
'test_count': 1,
duration = 0
'error_count': 0,
'failure_count': result_failed,
try:
'skip_count': 0,
sys.path.append('${cython_nogil:location}/nogil_test/')
'duration': 0,
test_module = importlib.import_module(test_name)
'command': '',
except ImportError as e:
'stdout': '',
failed = 1
'stderr': '',
stdout = str(e)
'html_test_result': ''
else:
}
start_time = datetime.datetime.now()
result_string = test_module.run(env, '${python3.5:location}/bin/python3')
end_time = datetime.datetime.now()
duration = (end_time - start_time).total_seconds()
failed = result_string['failed']
stdout = result_string['stdout']
test_line_dict['%s: %s' % ('Cython test', test_name)] = {
'test_count': 1,
'error_count': 0,
'failure_count': failed,
'skip_count': 0,
'duration': duration,
'command': '',
'stdout': stdout,
'stderr': '',
'html_test_result': '',
}
# Send results
# Send results
tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
...
@@ -80,8 +99,7 @@ def main():
...
@@ -80,8 +99,7 @@ def main():
break
break
print 'Submitting: "%s"' % test_result_line.name
print 'Submitting: "%s"' % test_result_line.name
print test_line_dict['Cython test: nogil extension initialization']
print test_line_dict
print result_string
# report status back to Nexedi ERP5
# report status back to Nexedi ERP5
test_result_line.stop(**test_line_dict[test_result_line.name])
test_result_line.stop(**test_line_dict[test_result_line.name])
...
...
software/cython_test/software.cfg
View file @
f5784f81
...
@@ -3,6 +3,7 @@ extends =
...
@@ -3,6 +3,7 @@ extends =
../../stack/slapos.cfg
../../stack/slapos.cfg
../../component/git/buildout.cfg
../../component/git/buildout.cfg
../../component/cython_nogil/buildout.cfg
../../component/cython_nogil/buildout.cfg
../../component/cython_lwan_coro/buildout.cfg
./buildout.hash.cfg
./buildout.hash.cfg
...
@@ -11,6 +12,7 @@ parts =
...
@@ -11,6 +12,7 @@ parts =
git
git
instance
instance
cython_nogil
cython_nogil
cython_lwan_coro
template-runTestSuite
template-runTestSuite
[eggs]
[eggs]
...
...
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