Merge lp:~cjohnston/qa-dashboard/primary-target-smoke into lp:qa-dashboard

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 589
Merged at revision: 591
Proposed branch: lp:~cjohnston/qa-dashboard/primary-target-smoke
Merge into: lp:qa-dashboard
Diff against target: 146 lines (+72/-6)
4 files modified
smokeng/config.py (+22/-0)
smokeng/static/smokeng/css/smokeng.css (+3/-0)
smokeng/templates/smokeng/overview.html (+39/-5)
smokeng/views.py (+8/-1)
To merge this branch: bzr merge lp:~cjohnston/qa-dashboard/primary-target-smoke
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Andy Doan (community) Approve
Chris Johnston Needs Resubmitting
Review via email: mp+182423@code.launchpad.net

Commit message

Show only primary target devices for smoke touch(_ro) results by default

Description of the change

asac has requested that we only show the primary target devices by default when we look at the touch(_ro) results. This MP satisfies that request.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:588
http://s-jenkins:8080/job/dashboard-ci/166/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/dashboard-ci/166/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andy Doan (doanac) wrote :

On 08/27/2013 10:30 AM, Chris Johnston wrote:

> For more details, see:
> https://code.launchpad.net/~cjohnston/qa-dashboard/primary-target-smoke/+merge/182423

> === modified file 'smokeng/templates/smokeng/overview.html'
> --- smokeng/templates/smokeng/overview.html 2013-08-07 14:25:40 +0000
> +++ smokeng/templates/smokeng/overview.html 2013-08-27 15:21:28 +0000
> + {% if platform = 'mobile' %}

A nitpick, but "mobile" is probably a bad word. I'd say "phablet" is
probably the least bad of the bad options.

> + <h3 class='nav-title'>
> + TARGETS
> + </h3>
> + <ul class='left_nav'>
> + <li{% if targets = 'primary' %} class="active"{% endif %}>
> + <a href="{% url smokeng_overview release current %}">Primary targets</a>
> + {% if platform = 'mobile' and targets = 'primary' %}
> + <ul class='left_nav'>
> + <br />
> + <li><small>grouper: Nexus 7</small></li>
> + <li><small>manta: Nexus 10</small></li>
> + </ul>

I assume this is right, but it seems like you are show 7 and 10 as
primary targets?

> + {% endif %}
> + </li>
> + <li{% if targets != 'primary' %} class="active"{% endif %}>
> + <a href="{% url smokeng_overview release current %}?show_all=1">All targets</a>
> + {% if platform = 'mobile' and targets != 'primary' %}
> + <ul class='left_nav'>
> + <br />
> + <li><small>grouper: Nexus 7</small></li>
> + <li><small>manta: Nexus 10</small></li>
> + <li><small>grouper: Nexus 7</small></li>
> + <li><small>manta: Nexus 10</small></li>

I think you meant grouper, manta, maguro, mako here. not repeating
grouper/manta?

> - <ul class='left_nav'>
> - <li><small>maguro: Galaxy Nexus</small></li>
> + </h3>
> + <ul class='left_nav'>
> + <li><small>mako: Nexus 4</small></li>

is this a copy/paste bug. maguro seems to get deleted by this?
> <li><small>mako: Nexus 4</small></li>
> <li><small>grouper: Nexus 7</small></li>
> <li><small>manta: Nexus 10</small></li>
> - </ul>
> + </ul>
> + {% endif %}

> === modified file 'smokeng/views.py'

> + if variant == 'touch' or variant == 'touch_ro':
> + platform = 'mobile'
> + show_targets = request.GET.get('show_all')
> + if show_targets is None or show_targets != "1":
> + targets = 'primary'
> + results = results.filter(
> + image__arch__in=primary_targets,
> + )

I'm not a big fan of how this looks. Seems like we could change
config.py to have a function like:

def primary_targets(variant):
    if variant in ('touch', 'touch_ro'):
         return ('mako', 'maguro')

    return None

then you could have:

   primary_tgts = config.primary_targets(variant)
   if request.GET.get('show_all', '1') != '1' and primary_tgts:
       results = results.filter(image__arch__in=primary_tgts)

Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
Revision history for this message
Andy Doan (doanac) :
review: Approve
Revision history for this message
Chris Johnston (cjohnston) wrote :
Download full text (167.1 KiB)

The attempt to merge lp:~cjohnston/qa-dashboard/primary-target-smoke into lp:qa-dashboard failed. Below is the output from the failed tests.

 * Adding ci
 * ci added.
 * Adding graphics
 * graphics added.
Creating test database for alias 'default'...
? You have no migrations for the 'performance' app. You might want some.
Destroying test database for alias 'default'...

.............EEEEEEEEEEEEEEE........................................WARNING:root:extension: 'error'
.....E...............EEEEEEEEEEEEEE.............................EEEEEEEEEEEEEEEEEEEEEEEEE.......EEEEEEEEE..........EEEEEEEEEEEEEEEEEEEEE.EEE
======================================================================
ERROR: test_bootspeed_api_arch_list_url (bootspeed.tests.TestBootspeedUrls)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/dash/bootspeed/tests.py", line 529, in test_bootspeed_api_arch_list_url
    'bootspeed_api_arch_list',
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 476, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 363, in _reverse_with_prefix
    possibilities = self.reverse_dict.getlist(lookup_view)
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 276, in reverse_dict
    self._populate()
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 253, in _populate
    for name in pattern.reverse_dict:
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 276, in reverse_dict
    self._populate()
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 265, in _populate
    lookups.appendlist(pattern.callback, (bits, p_pattern, pattern.default_args))
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 216, in callback
    self._callback = get_callable(self._callback_str)
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 27, in wrapper
    result = func(*args)
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 92, in get_callable
    lookup_view = getattr(import_module(mod_name), func_name)
  File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/ubuntu/dash/smokeng/views.py", line 36, in <module>
    from smokeng.config import primary_targets
ImportError: No module named config

======================================================================
ERROR: test_bootspeed_api_arch_overall_url (bootspeed.tests.TestBootspeedUrls)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/dash/bootspeed/tests.py", line 544, in test_bootspeed_api_arch_overall_url
    args=args,
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 476, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 363, in _reverse_wi...

588. By Chris Johnston

Add support for showing only primary target devices smoke results

589. By Chris Johnston

Fixes touch displaying primary and all targets

Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
Revision history for this message
Andy Doan (doanac) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:589
http://s-jenkins:8080/job/dashboard-ci/168/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/dashboard-ci/168/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'smokeng/config.py'
2--- smokeng/config.py 1970-01-01 00:00:00 +0000
3+++ smokeng/config.py 2013-08-30 19:26:41 +0000
4@@ -0,0 +1,22 @@
5+# QA Dashboard
6+
7+# Copyright 2013 Canonical Ltd.
8+
9+# This program is free software: you can redistribute it and/or modify it
10+# under the terms of the GNU Affero General Public License version 3, as
11+# published by the Free Software Foundation.
12+
13+# This program is distributed in the hope that it will be useful, but
14+# WITHOUT ANY WARRANTY; without even the implied warranties of
15+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
16+# PURPOSE. See the GNU Affero General Public License for more details.
17+
18+# You should have received a copy of the GNU Affero General Public License
19+# along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
21+
22+def primary_targets(variant):
23+ if variant in ('touch', 'touch_ro'):
24+ return ('mako', 'maguro')
25+ else:
26+ return None
27
28=== added directory 'smokeng/static'
29=== added directory 'smokeng/static/smokeng'
30=== added directory 'smokeng/static/smokeng/css'
31=== added file 'smokeng/static/smokeng/css/smokeng.css'
32--- smokeng/static/smokeng/css/smokeng.css 1970-01-01 00:00:00 +0000
33+++ smokeng/static/smokeng/css/smokeng.css 2013-08-30 19:26:41 +0000
34@@ -0,0 +1,3 @@
35+li.targets {
36+ background-position: top left !important;
37+}
38
39=== modified file 'smokeng/templates/smokeng/overview.html'
40--- smokeng/templates/smokeng/overview.html 2013-08-07 14:25:40 +0000
41+++ smokeng/templates/smokeng/overview.html 2013-08-30 19:26:41 +0000
42@@ -1,10 +1,13 @@
43 {% extends "smokeng/smoke_layout.html" %}
44-{% load dashboard_extras %}
45+{% load dashboard_extras staticfiles %}
46 {% load render_table from django_tables2 %}
47
48 {% block page_name %}
49 Image testing for {{ release|capfirst }}
50 {% endblock %}
51+{% block extra_headers %}
52+<link href='{% static "smokeng/css/smokeng.css" %}' rel='stylesheet' type='text/css' />
53+{% endblock extra_headers %}
54 {% block content %}
55 <div class='grid_15'>
56 <h2>
57@@ -39,15 +42,46 @@
58 </li>
59 {% endfor %}
60 </ul>
61- <h3 class='nav-title'>
62+ {% if current = 'touch' or current = 'touch_ro' %}
63+ <h3 class='nav-title'>
64+ TARGETS
65+ </h3>
66+ <ul class='left_nav'>
67+ <li{% if targets = 'primary' %} class="active targets"{% endif %}>
68+ <a href="{% url smokeng_overview release current %}">Primary targets</a>
69+ {% if targets = 'primary' %}
70+ <ul class='left_nav'>
71+ <br />
72+ <li><small>maguro: Galaxy Nexus</small></li>
73+ <li><small>mako: Nexus 4</small></li>
74+ </ul>
75+ {% endif %}
76+ </li>
77+ <li{% if targets != 'primary' %} class="active targets"{% endif %}>
78+ <a href="{% url smokeng_overview release current %}?show_all=1">All targets</a>
79+ {% if targets != 'primary' %}
80+ <ul class='left_nav'>
81+ <br />
82+ <li><small>maguro: Galaxy Nexus</small></li>
83+ <li><small>mako: Nexus 4</small></li>
84+ <li><small>grouper: Nexus 7</small></li>
85+ <li><small>manta: Nexus 10</small></li>
86+ </ul>
87+ {% endif %}
88+ </li>
89+ </ul>
90+ {% endif %}
91+ {% if current != 'touch' and current != 'touch_ro' %}
92+ <h3 class='nav-title'>
93 DEVICE CODE NAMES
94- </h3>
95- <ul class='left_nav'>
96+ </h3>
97+ <ul class='left_nav'>
98 <li><small>maguro: Galaxy Nexus</small></li>
99 <li><small>mako: Nexus 4</small></li>
100 <li><small>grouper: Nexus 7</small></li>
101 <li><small>manta: Nexus 10</small></li>
102- </ul>
103+ </ul>
104+ {% endif %}
105 </div>
106 <div class='grid_13'>
107 {% render_table table "table.html" %}
108
109=== modified file 'smokeng/views.py'
110--- smokeng/views.py 2013-08-19 16:34:44 +0000
111+++ smokeng/views.py 2013-08-30 19:26:41 +0000
112@@ -33,6 +33,7 @@
113 from common.views import index
114 from common.templatetags.dashboard_extras import decimal_to_percent
115
116+from smokeng.config import primary_targets
117 from smokeng.models import (
118 SmokeImage,
119 SmokeResult,
120@@ -180,12 +181,17 @@
121 publish=True,
122 image__release=release,
123 )
124-
125+ targets = ''
126 if variant is not None:
127 results = results.filter(
128 image__variant=variant,
129 )
130
131+ primary_tgts = primary_targets(variant)
132+ if request.GET.get('show_all') != '1' and primary_tgts:
133+ targets = 'primary'
134+ results = results.filter(image__arch__in=primary_tgts)
135+
136 results = results.values(
137 'image__build_number',
138 'image__variant',
139@@ -226,6 +232,7 @@
140 'releases': _get_releases(),
141 'variants': variants,
142 'current': variant,
143+ 'targets': targets,
144 'active': release,
145 'bread_crumb_trail': BreadCrumbTrail.leading_to(
146 overview,

Subscribers

People subscribed via source and target branches