diff --git a/server/fishtest/rundb.py b/server/fishtest/rundb.py index 984f899ab..80de178f6 100644 --- a/server/fishtest/rundb.py +++ b/server/fishtest/rundb.py @@ -469,19 +469,23 @@ def get_finished_runs( skip=0, limit=0, username="", - success_only=False, - yellow_only=False, - ltc_only=False, + status=False, + tc=False, + info="" ): q = {"finished": True} if username: q["args.username"] = username - if ltc_only: + if tc == "stc": + q["tc_base"] = {"$lte": 40} + if tc == "ltc": q["tc_base"] = {"$gte": 40} - if success_only: + if status == "green": q["is_green"] = True - if yellow_only: + if status == "yellow": q["is_yellow"] = True + if info: + q["args.info"] = {"$regex": ".*{}.*".format(info), "$options": "i"} c = self.runs.find( q, skip=skip, limit=limit, sort=[("last_updated", DESCENDING)] diff --git a/server/fishtest/static/css/application.css b/server/fishtest/static/css/application.css index 122b8a80f..57231eb7f 100644 --- a/server/fishtest/static/css/application.css +++ b/server/fishtest/static/css/application.css @@ -264,15 +264,19 @@ legend { content: "\f00b"; } -.mainnavbar [href="/tests/finished?success_only=1"]::before { +.mainnavbar [href="/tests/finished"]::before { + content: "\f11e"; +} + +.mainnavbar [href="/tests/finished?status=green"]::before { content: "\f14a"; } -.mainnavbar [href="/tests/finished?yellow_only=1"]::before { +.mainnavbar [href="/tests/finished?status=yellow"]::before { content: "\f3fd"; } -.mainnavbar [href="/tests/finished?ltc_only=1"]::before { +.mainnavbar [href="/tests/finished?tc=ltc"]::before { content: "\f017"; } diff --git a/server/fishtest/templates/actions.mak b/server/fishtest/templates/actions.mak index ab854b488..856432ace 100644 --- a/server/fishtest/templates/actions.mak +++ b/server/fishtest/templates/actions.mak @@ -32,7 +32,7 @@
- +
@@ -78,5 +78,5 @@ diff --git a/server/fishtest/templates/base.mak b/server/fishtest/templates/base.mak index 25be9b0c5..3bf334e88 100644 --- a/server/fishtest/templates/base.mak +++ b/server/fishtest/templates/base.mak @@ -148,9 +148,10 @@ monitoring = request.rundb.conn["admin"].command("getFreeMonitoringStatus") Tests diff --git a/server/fishtest/templates/run_table.mak b/server/fishtest/templates/run_table.mak index b9a93bb15..00a3a3c82 100644 --- a/server/fishtest/templates/run_table.mak +++ b/server/fishtest/templates/run_table.mak @@ -1,10 +1,10 @@ -<%page args="runs, pages=None, show_delete=False, header=None, count=None, toggle=None, alt=None, title=''"/> +<%page args="runs, pages=None, show_delete=False, header=None, count=None, toggle=None, alt=None"/> <%namespace name="base" file="base.mak"/> % if toggle is None: % endif diff --git a/server/fishtest/templates/tests_finished.mak b/server/fishtest/templates/tests_finished.mak index a26d0e726..d02d894a4 100644 --- a/server/fishtest/templates/tests_finished.mak +++ b/server/fishtest/templates/tests_finished.mak @@ -1,32 +1,44 @@ <%inherit file="base.mak"/> -<% - title = "" - if "ltc_only" in request.url: - title += " - LTC" - if "success_only" in request.url: - title += " - Greens" - if "yellow_only" in request.url: - title += " - Yellows" -%>

Finished Tests - % if 'success_only' in request.url: - - Greens - % elif 'yellow_only' in request.url: - - Yellows - % elif 'ltc_only' in request.url: - - LTC - % endif

+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ <%include file="run_table.mak" args="runs=finished_runs, header='Finished', count=num_finished_runs, - pages=finished_runs_pages, - title=title" + pages=finished_runs_pages" /> diff --git a/server/fishtest/views.py b/server/fishtest/views.py index ce3a73950..b80d3de7b 100644 --- a/server/fishtest/views.py +++ b/server/fishtest/views.py @@ -1166,19 +1166,19 @@ def tests_view(request): def get_paginated_finished_runs(request): username = request.matchdict.get("username", "") - success_only = request.params.get("success_only", False) - yellow_only = request.params.get("yellow_only", False) - ltc_only = request.params.get("ltc_only", False) + status = request.params.get("status", False) + tc = request.params.get("tc", False) + info = request.params.get("info", False) page_idx = max(0, int(request.params.get("page", 1)) - 1) page_size = 25 finished_runs, num_finished_runs = request.rundb.get_finished_runs( username=username, - success_only=success_only, - yellow_only=yellow_only, - ltc_only=ltc_only, + status=status, + tc=tc, skip=page_idx * page_size, limit=page_size, + info=info, ) pages = [ @@ -1217,12 +1217,12 @@ def get_paginated_finished_runs(request): ) for page in pages: - if success_only: - page["url"] += "&success_only=1" - if yellow_only: - page["url"] += "&yellow_only=1" - if ltc_only: - page["url"] += "<c_only=1" + if status: + page["url"] += "&status={}".format(status) + if tc: + page["url"] += "&tc={}".format(tc) + if info: + page["url"] += "&info={}".format(info) failed_runs = [] for run in finished_runs: diff --git a/server/tests/test_rundb.py b/server/tests/test_rundb.py index c0ca118ad..b0d2f764e 100644 --- a/server/tests/test_rundb.py +++ b/server/tests/test_rundb.py @@ -190,7 +190,7 @@ def test_30_finish(self): self.rundb.buffer(run, True) def test_40_list_LTC(self): - finished_runs = self.rundb.get_finished_runs(limit=3, ltc_only=True)[0] + finished_runs = self.rundb.get_finished_runs(limit=3, tc="ltc")[0] for run in finished_runs: print(run["args"]["tc"]) diff --git a/server/utils/test_queries.py b/server/utils/test_queries.py index a975ca839..bf150fcd0 100644 --- a/server/utils/test_queries.py +++ b/server/utils/test_queries.py @@ -49,7 +49,7 @@ def qlen(c): print("{} rows {:1.4f}".format(qlen(c), end - start) + "s\nFetching finished runs ...") start = time.time() c, n = rundb.get_finished_runs( - skip=0, limit=50, username="", success_only=False, ltc_only=False + skip=0, limit=50, username="", status=False, tc=False ) end = time.time() @@ -59,7 +59,7 @@ def qlen(c): ) start = time.time() c, n = rundb.get_finished_runs( - skip=0, limit=50, username="vdv", success_only=False, ltc_only=False + skip=0, limit=50, username="vdv", status=False, tc=False ) end = time.time()