def results_to_html(results_dict, cs_base_url, bucket, test_name, builder_name, build_number): """Convert list of test results into html format.""" test_rows_header, test_rows = create_test_table(results_dict, cs_base_url, test_name) suite_rows_header, suite_rows, suite_row_footer = create_suite_table( results_dict) suite_table_values = { 'table_id': 'suite-table', 'table_headers': suite_rows_header, 'table_row_blocks': suite_rows, 'table_footer': suite_row_footer, } test_table_values = { 'table_id': 'test-table', 'table_headers': test_rows_header, 'table_row_blocks': test_rows, } main_template = JINJA_ENVIRONMENT.get_template( os.path.join('template', 'main.html')) dest = google_storage_helper.unique_name( '%s_%s_%s' % (test_name, builder_name, build_number)) result_details_link = google_storage_helper.get_url_link( dest, '%s/html' % bucket) return (main_template.render( # pylint: disable=no-member {'tb_values': [suite_table_values, test_table_values], 'feedback_url': feedback_url(result_details_link) }), dest, result_details_link)
def results_to_html(results_dict, cs_base_url, bucket, test_name, builder_name, build_number): """Convert list of test results into html format.""" test_rows_header, test_rows = create_test_table(results_dict, cs_base_url, test_name) suite_rows_header, suite_rows, suite_row_footer = create_suite_table( results_dict) suite_table_values = { 'table_id': 'suite-table', 'table_headers': suite_rows_header, 'table_row_blocks': suite_rows, 'table_footer': suite_row_footer, } test_table_values = { 'table_id': 'test-table', 'table_headers': test_rows_header, 'table_row_blocks': test_rows, } main_template = JINJA_ENVIRONMENT.get_template( os.path.join('template', 'main.html')) dest = google_storage_helper.unique_name( '%s_%s_%s' % (test_name, builder_name, build_number)) result_details_link = google_storage_helper.get_url_link( dest, '%s/html' % bucket) return (main_template.render( # pylint: disable=no-member {'tb_values': [suite_table_values, test_table_values], 'feedback_url': feedback_url(result_details_link) }), dest, result_details_link)
def results_to_html(results_dict, cs_base_url, bucket, test_name, builder_name, build_number, local_output): """Convert list of test results into html format. Args: local_output: Whether this results file is uploaded to Google Storage or just a local file. """ test_rows_header, test_rows = create_test_table( results_dict, cs_base_url, test_name) suite_rows_header, suite_rows, suite_row_footer = create_suite_table( results_dict) suite_table_values = { 'table_id': 'suite-table', 'table_headers': suite_rows_header, 'table_row_blocks': suite_rows, 'table_footer': suite_row_footer, } test_table_values = { 'table_id': 'test-table', 'table_headers': test_rows_header, 'table_row_blocks': test_rows, } main_template = JINJA_ENVIRONMENT.get_template( os.path.join('template', 'main.html')) if local_output: html_render = main_template.render( # pylint: disable=no-member { 'tb_values': [suite_table_values, test_table_values], 'feedback_url': feedback_url(None), }) return (html_render, None, None) else: dest = google_storage_helper.unique_name( '%s_%s_%s' % (test_name, builder_name, build_number)) result_details_link = google_storage_helper.get_url_link( dest, '%s/html' % bucket) html_render = main_template.render( # pylint: disable=no-member { 'tb_values': [suite_table_values, test_table_values], 'feedback_url': feedback_url(result_details_link), }) return (html_render, dest, result_details_link)
def results_to_html(results_dict, cs_base_url, bucket, test_name, builder_name, build_number, local_output): """Convert list of test results into html format. Args: local_output: Whether this results file is uploaded to Google Storage or just a local file. """ test_rows_header, test_rows = create_test_table(results_dict, cs_base_url, test_name) suite_rows_header, suite_rows, suite_row_footer = create_suite_table( results_dict) suite_table_values = { 'table_id': 'suite-table', 'table_headers': suite_rows_header, 'table_row_blocks': suite_rows, 'table_footer': suite_row_footer, } test_table_values = { 'table_id': 'test-table', 'table_headers': test_rows_header, 'table_row_blocks': test_rows, } main_template = JINJA_ENVIRONMENT.get_template( os.path.join('template', 'main.html')) if local_output: html_render = main_template.render( # pylint: disable=no-member { 'tb_values': [suite_table_values, test_table_values], 'feedback_url': feedback_url(None), }) return (html_render, None, None) else: dest = google_storage_helper.unique_name( '%s_%s_%s' % (test_name, builder_name, build_number)) result_details_link = google_storage_helper.get_url_link( dest, '%s/html' % bucket) html_render = main_template.render( # pylint: disable=no-member { 'tb_values': [suite_table_values, test_table_values], 'feedback_url': feedback_url(result_details_link), }) return (html_render, dest, result_details_link)
def _Link(self): return google_storage_helper.get_url_link(self._upload_path, self._bucket)
def _Link(self): return google_storage_helper.get_url_link( self._upload_path, self._bucket)