[PATCH] D68803: [LNT] Python 3 support: sort benchmark regressing

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 08:50:11 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D68802: [LNT] Python 3 support: fix writing report to tmp file.

Test server/ui/change_processing.py makes an assumption about the order
in which benchmark are listed when a regression occurs but these are put
in a set before being iterated over for printing. Since set have no
guarantee of order, the test is fragile and fails on Python 3 due to
different implementation of Set. This commit sort the benchmark when
printing them so that the output is consistent. It also adapts the
testcase accordingly.


https://reviews.llvm.org/D68803

Files:
  lnt/server/db/regression.py
  tests/server/ui/change_processing.py


Index: tests/server/ui/change_processing.py
===================================================================
--- tests/server/ui/change_processing.py
+++ tests/server/ui/change_processing.py
@@ -212,7 +212,7 @@
         session.commit()
 
         r2 = rebuild_title(session, ts_db, self.regression)
-        expected_title = "Regression of 6 benchmarks: foo, bar"
+        expected_title = "Regression of 6 benchmarks: bar, foo"
         self.assertEquals(r2.title, expected_title)
 
     def test_regression_evolution(self):
Index: lnt/server/db/regression.py
===================================================================
--- lnt/server/db/regression.py
+++ lnt/server/db/regression.py
@@ -71,7 +71,7 @@
             fc = ri.field_change
             benchmarks.add(shortname(fc.test.name))
         FMT = "Regression of {} benchmarks: {}"
-        title = FMT.format(new_size, ', '.join(benchmarks))
+        title = FMT.format(new_size, ', '.join(sorted(benchmarks)))
         # Crop long titles.
         title = (title[:120] + '...') if len(title) > 120 else title
         regression.title = title


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68803.224369.patch
Type: text/x-patch
Size: 1114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/8cea583a/attachment.bin>


More information about the llvm-commits mailing list