Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add ability to sort on latest result while running tests

  • Loading branch information...
commit a5ba7837138f295cbadc9332a4e2df7dae6d20e6 1 parent 8186f31
@camd camd authored
View
12 moztrap/view/runtests/views.py
@@ -3,6 +3,7 @@
"""
import json
+from django.db.models import Max
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
@@ -215,6 +216,12 @@ def run(request, run_id, env_id):
envform = EnvironmentSelectionForm(
current=environment.id, environments=run.environments.all())
+ current_result_select = (
+ "SELECT status from execution_result as r "
+ "WHERE r.runcaseversion_id = execution_runcaseversion.id "
+ "AND r.status in ('passed', 'invalidated', 'failed') "
+ "AND r.is_latest = 1 "
+ "ORDER BY r.created_on DESC LIMIT 1")
return TemplateResponse(
request,
@@ -229,7 +236,10 @@ def run(request, run_id, env_id):
"caseversion").prefetch_related(
"caseversion__tags",
"caseversion__case__suites",
- ).filter(environments=environment),
+ ).filter(
+ environments=environment,
+ ).extra(select={
+ "current_result": current_result_select}),
"finder": {
# finder decorator populates top column (products), we
# prepopulate the other two columns
View
2  templates/runtests/list/_run_listordering.html
@@ -2,7 +2,7 @@
{% block sortitems %}
<li class="sortitem bybulk-open"><a href="#" title="show all details">bulk open</a></li>
- {% include "lists/_sortitem.html" with sortname="results" %}
+ {% include "lists/_sortitem.html" with sortname="results" sortID="current_result" %}
{% include "lists/_sortitem.html" with sortname="name" sortID="caseversion__name" %}
{% include "lists/_sortitem.html" with sortname="suites" %}
{% include "lists/_sortitem.html" with sortname="order" sortID="order" %}
Please sign in to comment.
Something went wrong with that request. Please try again.