Skip to content

Consolidate waterfall test results #1168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions workspace_tools/singletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def get_version():
_opts_mut_reset_type=opts.mut_reset_type,
_opts_jobs=opts.jobs,
_opts_waterfall_test=opts.waterfall_test,
_opts_consolidate_waterfall_test=opts.consolidate_waterfall_test,
_opts_extend_test_timeout=opts.extend_test_timeout)

# Runs test suite in CLI mode
Expand Down
45 changes: 32 additions & 13 deletions workspace_tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def __init__(self,
_opts_mut_reset_type=None,
_opts_jobs=None,
_opts_waterfall_test=None,
_opts_consolidate_waterfall_test=None,
_opts_extend_test_timeout=None):
""" Let's try hard to init this object
"""
Expand Down Expand Up @@ -236,6 +237,7 @@ def __init__(self,
self.opts_mut_reset_type = _opts_mut_reset_type
self.opts_jobs = _opts_jobs if _opts_jobs is not None else 1
self.opts_waterfall_test = _opts_waterfall_test
self.opts_consolidate_waterfall_test = _opts_consolidate_waterfall_test
self.opts_extend_test_timeout = _opts_extend_test_timeout
self.opts_clean = _clean

Expand Down Expand Up @@ -485,18 +487,21 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep
)

# Add detailed test result to test summary structure
if target not in self.test_summary_ext[toolchain][target]:
self.test_summary_ext[toolchain][target][test_id] = { 0: {
'single_test_result' : self.TEST_RESULT_BUILD_FAILED,
'single_test_output' : '',
'target_name' : target,
'toolchain_name' : toolchain,
'test_id' : test_id,
'test_description' : 'Toolchain build failed',
'elapsed_time' : 0,
'duration' : 0,
'copy_method' : None
}}
if test_id not in self.test_summary_ext[toolchain][target]:
self.test_summary_ext[toolchain][target][test_id] = []

self.test_summary_ext[toolchain][target][test_id].append({ 0: {
'single_test_result' : self.TEST_RESULT_BUILD_FAILED,
'single_test_output' : '',
'target_name' : target,
'target_name_unique': target,
'toolchain_name' : toolchain,
'test_id' : test_id,
'test_description' : 'Toolchain build failed',
'elapsed_time' : 0,
'duration' : 0,
'copy_method' : None
}})
continue

if self.opts_only_build_tests:
Expand Down Expand Up @@ -537,7 +542,15 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep
if target not in self.test_summary_ext[toolchain][target]:
if test_id not in self.test_summary_ext[toolchain][target]:
self.test_summary_ext[toolchain][target][test_id] = []
self.test_summary_ext[toolchain][target][test_id].append(detailed_test_results)

append_test_result = detailed_test_results

# If waterfall and consolidate-waterfall options are enabled,
# only include the last test result in the report.
if self.opts_waterfall_test and self.opts_consolidate_waterfall_test:
append_test_result = {0: detailed_test_results[len(detailed_test_results) - 1]}

self.test_summary_ext[toolchain][target][test_id].append(append_test_result)

test_suite_properties['skipped'] = ', '.join(test_suite_properties['skipped'])
self.test_suite_properties_ext[target][toolchain] = test_suite_properties
Expand Down Expand Up @@ -1835,6 +1848,12 @@ def get_default_test_options_parser():
dest='test_global_loops_value',
help='Set global number of test loops per test. Default value is set 1')

parser.add_option('', '--consolidate-waterfall',
dest='consolidate_waterfall_test',
default=False,
action="store_true",
help='Used with --waterfall option. Adds only one test to report reflecting outcome of waterfall test.')

parser.add_option('-W', '--waterfall',
dest='waterfall_test',
default=False,
Expand Down