# HG changeset patch # User cmlenz # Date 1132335885 0 # Node ID 29f7b0d7dc4d0130125b6bc6bed48f41dd94b2b6 # Parent 701844caef76696f5b978ec4617b49f811c1ee55 Improvements to the report summarizers: * Display totals for test coverage and test results. * Highlight test fixtures that have failures. diff --git a/bitten/trac_ext/htdocs/bitten.css b/bitten/trac_ext/htdocs/bitten.css --- a/bitten/trac_ext/htdocs/bitten.css +++ b/bitten/trac_ext/htdocs/bitten.css @@ -150,6 +150,18 @@ clear: both; padding: 5px; } #content.build .tab-content table { margin: 0; } +#content.build tbody.totals td, #content.build tbody.totals th { + font-weight: bold; +} +#content.build table.tests tr.failed { background: #d99; } +#content.build table.tests tr.failed td { font-weight: bold; } +#content.build table.tests tr.failed:hover td, +#content.build table.tests tr.failed:hover tr { background: #966; } +#content.build table.tests tr.failed :link, +#content.build table.tests tr.failed :visited { color: #933 } +#content.build table.tests tr.failed :link:hover, +#content.build table.tests tr.failed :visited:hover { color: #fff; } + #content.build .log { border: 1px inset; overflow: auto; max-height: 30em; width: 100%; white-space: pre; } #content.build .log code { padding: 0 5px; } diff --git a/bitten/trac_ext/summarizers.py b/bitten/trac_ext/summarizers.py --- a/bitten/trac_ext/summarizers.py +++ b/bitten/trac_ext/summarizers.py @@ -48,14 +48,20 @@ GROUP BY file, fixture ORDER BY fixture""", (build.id,)) data = [] + total_success, total_failure, total_error = 0, 0, 0 for fixture, file, num_success, num_failure, num_error in cursor: data.append({'name': fixture, 'num_success': num_success, 'num_error': num_error, 'num_failure': num_failure}) + total_success += num_success + total_failure += num_failure + total_error += num_error if file: data[-1]['href'] = self.env.href.browser(config.path, file) hdf = HDFWrapper(loadpaths=Chrome(self.env).get_all_templates_dirs()) hdf['data'] = data + hdf['totals'] = {'success': total_success, 'failure': total_failure, + 'error': total_error} return hdf.render('bitten_summary_tests.cs') @@ -90,11 +96,17 @@ GROUP BY file, unit ORDER BY unit""", (build.id,)) data = [] + total_loc, total_cov = 0, 0 for unit, file, loc, cov in cursor: - data.append({'name': unit, 'loc': loc, 'cov': cov}) + loc, cov = int(loc), float(cov) + if loc: + data.append({'name': unit, 'loc': loc, 'cov': int(cov)}) + total_loc += loc + total_cov += loc * cov if file: data[-1]['href'] = self.env.href.browser(config.path, file) hdf = HDFWrapper(loadpaths=Chrome(self.env).get_all_templates_dirs()) hdf['data'] = data + hdf['totals'] = {'loc': total_loc, 'cov': int(total_cov / total_loc)} return hdf.render('bitten_summary_coverage.cs') diff --git a/bitten/trac_ext/templates/bitten_summary_coverage.cs b/bitten/trac_ext/templates/bitten_summary_coverage.cs --- a/bitten/trac_ext/templates/bitten_summary_coverage.cs +++ b/bitten/trac_ext/templates/bitten_summary_coverage.cs @@ -1,7 +1,7 @@

Code Coverage

- + + + + +
UnitLines of CodeCoverage
Coverage
%
Total%
diff --git a/bitten/trac_ext/templates/bitten_summary_tests.cs b/bitten/trac_ext/templates/bitten_summary_tests.cs --- a/bitten/trac_ext/templates/bitten_summary_tests.cs +++ b/bitten/trac_ext/templates/bitten_summary_tests.cs @@ -5,12 +5,19 @@ FailuresErrors class="failed"> + + Total + + +