aboutsummaryrefslogtreecommitdiff
path: root/lnt/server
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2019-09-27 21:57:00 +0000
committerHubert Tong <hubert.reinterpretcast@gmail.com>2019-09-27 21:57:00 +0000
commit2b1eab3e340844285da39647d25cb01f10223ffe (patch)
treea9f0c00a34466352e57df90f7dff5cf111782131 /lnt/server
parent19d0279bc9050aa93f06f5575d6d3b2e7dd5f955 (diff)
[LNT] Sort machines by ID as expected by test case
Summary: `tests/lnttool/admin.shtest` fails in some environments because it expects the `list-machines` output in a certain order. Assuming ascending order, the matching sort would be the one based on the id. In particular, "localhost" follows "LNT" in both ASCII `strcmp` and also with case-insensitive sorting, and the test expects "localhost" first. I'm open to doing the sorting on the client side, but this patch sorts on the server side mainly to demonstrate that the expectation of the test was unwarranted given the state of the code. Sorting on the server side also benefits all clients, as opposed to just the ones that are part of this package. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67884 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lnt/server')
-rw-r--r--lnt/server/ui/api.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lnt/server/ui/api.py b/lnt/server/ui/api.py
index 32d431f..ab9b754 100644
--- a/lnt/server/ui/api.py
+++ b/lnt/server/ui/api.py
@@ -100,7 +100,7 @@ class Machines(Resource):
def get():
ts = request.get_testsuite()
session = request.session
- machines = session.query(ts.Machine).all()
+ machines = session.query(ts.Machine).order_by(ts.Machine.id).all()
result = common_fields_factory()
result['machines'] = machines