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

wip

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