Commit 048b253d authored by Julien Muchembled's avatar Julien Muchembled

wip

parent 49f586d7
......@@ -7,9 +7,10 @@ from erp5.util import taskdistribution
from time import gmtime, strftime
# pattern to get test counts from stdout
SUMMARY_RE = re.compile( \
r'^(.*)Summary (.*) (?P<test_count>\d+) (.*) (?P<error_count>\d+|\.) (.*) (?P<expected_count>\d+|\.) (.*) (?P<skip_count>\d+|\.) (.*) (?P<duration>\d+(\.\d*)?|\.\d+)s', \
re.MULTILINE)
SUMMARY_RE = re.compile(
r'^(.*)Summary (.*) (?P<test_count>\d+) (.*) (?P<unexpected_count>\d+|\.)'
r' (.*) (?P<expected_count>\d+|\.) (.*) (?P<skip_count>\d+|\.)'
r' (.*) (?P<duration>\d+(\.\d*)?|\.\d+)s', re.MULTILINE)
# NEO specific environment
TEMP_DIRECTORY = '{{neo_temp_directory}}/neo_tests'
......@@ -21,7 +22,7 @@ def parseTestStdOut(data):
Parse output of NEO testrunner script.
"""
test_count = 0
error_count = 0
unexpected_count = 0
expected_count = 0
skip_count = 0
duration = 0
......@@ -34,36 +35,32 @@ def parseTestStdOut(data):
# it can match '.'!
skip_count = int(groupdict['skip_count'])
except ValueError:
skip_count = 0
pass
try:
# it can match '.'!
error_count = int(groupdict['error_count'])
unexpected_count = int(groupdict['unexpected_count'])
except ValueError:
error_count = 0
pass
try:
# it can match '.'!
expected_count = int(groupdict['expected_count'])
except ValueError:
expected_count = 0
pass
return test_count, error_count, expected_count, skip_count, duration
return test_count, unexpected_count, expected_count, skip_count, duration
def main():
parser = argparse.ArgumentParser(description='Run a test suite.')
parser.add_argument('--test_suite', help='The test suite name')
parser.add_argument('--test_suite_title', help='The test suite title',
default=None)
parser.add_argument('--test_node_title', help='The test node title',
default=None)
parser.add_argument('--project_title', help='The project title',
default=None)
parser.add_argument('--test_suite_title', help='The test suite title')
parser.add_argument('--test_node_title', help='The test node title')
parser.add_argument('--project_title', help='The project title')
parser.add_argument('--revision', help='The revision to test',
default='dummy_revision')
parser.add_argument('--node_quantity', help='Number of parallel tests to run',
default=1, type=int)
parser.add_argument('--master_url',
help='The Url of Master controling many suites',
default=None)
help='The Url of Master controling many suites')
args = parser.parse_args()
......@@ -115,7 +112,7 @@ def main():
# parse test stdout / stderr, hint to speed up use files first!
stdout, stderr = p.communicate()
date = strftime("%Y/%m/%d %H:%M:%S", gmtime())
test_count, error_count, expected_count, skip_count, duration = \
test_count, unexpected_count, expected_count, skip_count, duration = \
parseTestStdOut(stdout)
# print to stdout so we can see in testnode logs
......@@ -125,8 +122,8 @@ def main():
# report status back to Nexedi ERP5
test_result_line.stop(
test_count = test_count,
error_count = error_count,
failure_count = expected_count,
error_count = unexpected_count, # XXX
failure_count = expected_count, # XXX
skip_count = skip_count,
duration = duration,
date = date,
......
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