[LNT] r286540 - Filter regression views by machine name
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 17:25:30 PST 2016
Author: cmatthews
Date: Thu Nov 10 19:25:29 2016
New Revision: 286540
URL: http://llvm.org/viewvc/llvm-project?rev=286540&view=rev
Log:
Filter regression views by machine name
In some cases it is nice to see regressions only for a particular
machine. This adds a argument to the regression view to filter
regressions that don’t have at least one change from a named machine.
Modified:
lnt/trunk/lnt/server/ui/regression_views.py
lnt/trunk/tests/server/ui/V4Pages.py
Modified: lnt/trunk/lnt/server/ui/regression_views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/regression_views.py?rev=286540&r1=286539&r2=286540&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/regression_views.py (original)
+++ lnt/trunk/lnt/server/ui/regression_views.py Thu Nov 10 19:25:29 2016
@@ -157,7 +157,7 @@ def v4_regression_list():
ts = request.get_testsuite()
form = MergeRegressionForm(request.form)
-
+ machine_filter = request.args.get('machine_filter')
if request.method == 'POST' and \
request.form['merge_btn'] == "Merge Regressions":
regressions_id_to_merge = form.regression_checkboxes.data
@@ -200,12 +200,23 @@ def v4_regression_list():
regression_sizes = []
impacts = []
ages = []
+
+ filtered_regressions = []
for regression in regression_info:
- form.regression_checkboxes.choices.append((regression.id, 1,))
reg_inds = ts.query(ts.RegressionIndicator) \
.filter(ts.RegressionIndicator.regression_id ==
regression.id) \
.all()
+ if machine_filter:
+ machine_names = set([x.field_change.machine.name for x in reg_inds])
+ if machine_filter in machine_names:
+ filtered_regressions.append(regression)
+ else:
+ continue
+ else:
+ filtered_regressions.append(regression)
+ form.regression_checkboxes.choices.append((regression.id, 1,))
+
regression_sizes.append(len(reg_inds))
impacts.append(calc_impact(ts, [x.field_change for x in reg_inds]))
# Now guess the regression age:
@@ -214,10 +225,10 @@ def v4_regression_list():
else:
age = EmptyDate()
ages.append(age)
-
+
return render_template("v4_regression_list.html",
testsuite_name=g.testsuite_name,
- regressions=regression_info,
+ regressions=filtered_regressions,
highlight=request.args.get('highlight'),
title=title,
RegressionState=RegressionState,
Modified: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=286540&r1=286539&r2=286540&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (original)
+++ lnt/trunk/tests/server/ui/V4Pages.py Thu Nov 10 19:25:29 2016
@@ -427,7 +427,9 @@ def main():
check_redirect(client, '/v4/nts/regressions/new_from_graph/1/1/1/1', '/v4/nts/regressions/1')
check_code(client, '/v4/nts/regressions/')
-
+ check_code(client, '/v4/nts/regressions/?machine_filter=machine2')
+ check_code(client, '/v4/nts/regressions/?machine_filter=machine0')
+
check_code(client, '/v4/nts/regressions/1')
check_json(client, '/v4/nts/regressions/1?json=True')
More information about the llvm-commits
mailing list