Commit cbaa544b authored by Damien Lespiau's avatar Damien Lespiau
Browse files

testresult: Add UI side of test results on revisions


Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
parent 4e09396b
......@@ -27,6 +27,13 @@ pre {
border-radius: 0;
}
.cursor-pointer {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
cursor: pointer;
}
.floaty {
position: fixed;
left: 0.1em;
......@@ -123,6 +130,10 @@ div.well > table {
margin-bottom: 0px;
}
div.small-panel-heading {
padding: 5px;
}
/* messages */
#messages {
background: #e0e0f0;
......@@ -494,3 +505,29 @@ div.box table.vertical {
float: right;
width: 49%;
}
/* test resuts */
.result-pending {
margin: 0px 8px;
background-color: #5bc0de;
}
.result-warning {
margin: 0px 8px;
background-color: #f0ad4e;
}
.result-failure {
margin: 0px 8px;
background-color: #d9534f;
}
.result-success {
margin: 0px 8px;
background-color: #5cb85c;
}
pre.test-result {
margin: 0px;
border: 0px;
}
......@@ -101,6 +101,19 @@ $(function () {
</table>
</div>
{% if revision.test_results %}
<h3>Tests</h3>
<div class="well transparent">
<div class="panel-group" id="test-accordion" role="tablist" aria-multiselectable="true">
{% for test_result in revision.test_results %}
{% include "patchwork/test-result.html" %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endfor %}
</div>
......
<div class="panel panel-default">
{% if test_result.summary %}
<div class="panel-heading small-panel-heading cursor-pointer" role="tab" data-toggle="collapse" href="#collapse-{{ forloop.counter }}" aria-expanded="false" aria-controls="collapse-{{ forloop.counter }}" id="heading-{{ forloop.counter }}">
{% else %}
<div class="panel-heading small-panel-heading" role="tab" id="heading-{{ forloop.counter }}">
{% endif %}
<span>{{ test_result.test.name }}</span>
<span class="label result-{{ test_result.get_state_display }}">
{{ test_result.get_state_display }}
</span>
{% if test_result.url %}
<span>
<a href="{{ test_result.url }}" onclick="(function(e){ e.stopPropagation(); })(event)">(See full logs)</a>
</span>
{% endif %}
</div>
{% if test_result.summary %}
<div id="collapse-{{ forloop.counter }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-{{ forloop.counter}}">
<pre class="panel-body test-result">
{{ test_result.summary }}</pre>
</div>
{% endif %}
</div>
......@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from patchwork.models import Patch, Project, Bundle
from patchwork.models import Patch, Project, Bundle, TestResult
from patchwork.forms import PatchForm, CreateBundleForm
from patchwork.requestcontext import PatchworkRequestContext
from django.shortcuts import render_to_response, get_object_or_404, redirect
......@@ -80,6 +80,9 @@ def patch(request, patch_id):
context['patchform'] = form
context['createbundleform'] = createbundleform
context['project'] = patch.project
context['test_results'] = TestResult.objects \
.filter(revision=None, patch=patch) \
.order_by('test__name').select_related('test')
return render_to_response('patchwork/patch.html', context)
......
......@@ -21,7 +21,7 @@ from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.views.generic import View
from patchwork.models import Project, Series, SeriesRevision
from patchwork.models import Project, Series, SeriesRevision, TestResult
class SeriesListView(View):
def get(self, request, *args, **kwargs):
......@@ -37,6 +37,9 @@ class SeriesView(View):
for revision in revisions:
revision.patch_list = revision.ordered_patches().\
select_related('state', 'submitter')
revision.test_results = TestResult.objects \
.filter(revision=revision, patch=None) \
.order_by('test__name').select_related('test')
return render(request, 'patchwork/series.html', {
'series': series,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment