[LNT] r350704 - [LNT] fix ValueError in a corner case of geomean comparison
Danila Malyutin via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 9 03:58:52 PST 2019
Author: danilaml
Date: Wed Jan 9 03:58:52 2019
New Revision: 350704
URL: http://llvm.org/viewvc/llvm-project?rev=350704&view=rev
Log:
[LNT] fix ValueError in a corner case of geomean comparison
Fixes ValueError('need more than 0 values to unpack',) that
could appear in some corner cases when viewing results (the fewer
runs you have in your db the more likely you'll encounter it).
Differential revision: https://reviews.llvm.org/D56133
Modified:
lnt/trunk/lnt/server/reporting/analysis.py
lnt/trunk/tests/server/ui/V4Pages.py
Modified: lnt/trunk/lnt/server/reporting/analysis.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/analysis.py?rev=350704&r1=350703&r2=350704&view=diff
==============================================================================
--- lnt/trunk/lnt/server/reporting/analysis.py (original)
+++ lnt/trunk/lnt/server/reporting/analysis.py Wed Jan 9 03:58:52 2019
@@ -368,11 +368,12 @@ class RunInfo(object):
return r
def get_geomean_comparison_result(self, run, compare_to, field, tests):
- if tests:
+ unchanged_tests = [(cr.previous, cr.current, cr.prev_hash, cr.cur_hash)
+ for _, _, cr in tests
+ if cr.get_test_status() == UNCHANGED_PASS]
+ if unchanged_tests:
prev_values, run_values, prev_hash, cur_hash = zip(
- *[(cr.previous, cr.current, cr.prev_hash, cr.cur_hash)
- for _, _, cr in tests
- if cr.get_test_status() == UNCHANGED_PASS])
+ *unchanged_tests)
prev_values = [x for x in prev_values if x is not None]
run_values = [x for x in run_values if x is not None]
prev_hash = [x for x in prev_hash if x is not None]
Modified: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=350704&r1=350703&r2=350704&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (original)
+++ lnt/trunk/tests/server/ui/V4Pages.py Wed Jan 9 03:58:52 2019
@@ -11,6 +11,9 @@
# Import a profile
# RUN: lnt import %t.instance %{shared_inputs}/profile-report.json
#
+# RUN: lnt import %t.instance %S/Inputs/sample-failed-report1.json
+# RUN: lnt import %t.instance %S/Inputs/sample-failed-report2.json
+#
# RUN: python %s %t.instance %{tidylib}
import logging
@@ -657,6 +660,10 @@ def main():
check_code(client, '/db_default/v4/nts/graph_for_sample/10/not_a_metric?foo=bar',
expected_code=HTTP_BAD_REQUEST)
+ # check get_geomean_comparison_result with empty unchanged_tests
+ check_html(client, '/v4/nts/11')
+ check_html(client, '/v4/nts/12')
+
if __name__ == '__main__':
main()
More information about the llvm-commits
mailing list