[PATCH] D56133: [LNT] fix ValueError in corner case

Danila Malyutin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 9 04:02:40 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL350704: [LNT] fix ValueError in a corner case of geomean comparison (authored by danilaml, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D56133?vs=179638&id=180813#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56133/new/

https://reviews.llvm.org/D56133

Files:
  lnt/trunk/lnt/server/reporting/analysis.py
  lnt/trunk/tests/server/ui/V4Pages.py


Index: lnt/trunk/tests/server/ui/V4Pages.py
===================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py
+++ lnt/trunk/tests/server/ui/V4Pages.py
@@ -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 @@
     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()
Index: lnt/trunk/lnt/server/reporting/analysis.py
===================================================================
--- lnt/trunk/lnt/server/reporting/analysis.py
+++ lnt/trunk/lnt/server/reporting/analysis.py
@@ -368,11 +368,12 @@
         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]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56133.180813.patch
Type: text/x-patch
Size: 1907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190109/6d948e5e/attachment.bin>


More information about the llvm-commits mailing list