* [PATCH 1/4] toaster: store task name in Target objects
2015-09-22 9:34 [PATCH 0/4] Fix for YOCTO #7442 Elliot Smith
@ 2015-09-22 9:34 ` Elliot Smith
2015-09-22 9:34 ` [PATCH 2/4] toaster: don't re-create " Elliot Smith
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2015-09-22 9:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
Information about a task is not stored in Target objects.
This makes it impossible to correctly operate with the builds
where task is specified.
Storing taks name is an enabler for other fixes in UI and backend
related to restarting builds.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
lib/toaster/bldcontrol/management/commands/runbuilds.py | 2 +-
lib/toaster/orm/models.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/toaster/bldcontrol/management/commands/runbuilds.py b/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 718e144..5243a50 100644
--- a/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -118,7 +118,7 @@ class Command(NoArgsCommand):
br.save()
# transpose target information
for brtarget in br.brtarget_set.all():
- Target.objects.create(build = br.build, target= brtarget.target)
+ Target.objects.create(build=br.build, target=brtarget.target, task=brtarget.task)
# transpose the launch errors in ToasterExceptions
for brerror in br.brerror_set.all():
LogMessage.objects.create(build = br.build, level = LogMessage.EXCEPTION, message = brerror.errmsg)
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index e4d2e87..883ecf4 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -270,7 +270,7 @@ class Project(models.Model):
)
for t in self.projecttarget_set.all():
BRTarget.objects.create(req = br, target = t.target, task = t.task)
- Target.objects.create(build = br.build, target = t.target)
+ Target.objects.create(build = br.build, target = t.target, task = t.task)
for v in self.projectvariable_set.all():
BRVariable.objects.create(req = br, name = v.name, value = v.value)
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/4] toaster: don't re-create Target objects
2015-09-22 9:34 [PATCH 0/4] Fix for YOCTO #7442 Elliot Smith
2015-09-22 9:34 ` [PATCH 1/4] toaster: store task name in Target objects Elliot Smith
@ 2015-09-22 9:34 ` Elliot Smith
2015-09-22 9:34 ` [PATCH 3/4] toaster: change UI to show tasks Elliot Smith
2015-09-22 9:34 ` [PATCH 4/4] toaster: add 2 UI tests Elliot Smith
3 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2015-09-22 9:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
Due to re-creating Target objects from bitbake events task information
stored in original objects is lost.
There is no valid reason to remove existing objects. It's safer to query
them instead of re-creating as original object contain more information
than events coming from bitbake.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
lib/bb/ui/buildinfohelper.py | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 6e313fe..e5f1e09 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -161,8 +161,6 @@ class ORMWrapper(object):
build.bitbake_version=build_info['bitbake_version']
build.save()
- Target.objects.filter(build = build).delete()
-
else:
build = Build.objects.create(
project = prj,
@@ -183,19 +181,6 @@ class ORMWrapper(object):
return build
- def create_target_objects(self, target_info):
- assert 'build' in target_info
- assert 'targets' in target_info
-
- targets = []
- for tgt_name in target_info['targets']:
- tgt_object = Target.objects.create( build = target_info['build'],
- target = tgt_name,
- is_image = False,
- )
- targets.append(tgt_object)
- return targets
-
def update_build_object(self, build, errors, warnings, taskfailures):
assert isinstance(build,Build)
assert isinstance(errors, int)
@@ -869,7 +854,7 @@ class BuildInfoHelper(object):
target_information['targets'] = event._pkgs
target_information['build'] = build_obj
- self.internal_state['targets'] = self.orm_wrapper.create_target_objects(target_information)
+ self.internal_state['targets'] = Target.objects.filter(build=target_information['build'])
# Save build configuration
data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/4] toaster: change UI to show tasks
2015-09-22 9:34 [PATCH 0/4] Fix for YOCTO #7442 Elliot Smith
2015-09-22 9:34 ` [PATCH 1/4] toaster: store task name in Target objects Elliot Smith
2015-09-22 9:34 ` [PATCH 2/4] toaster: don't re-create " Elliot Smith
@ 2015-09-22 9:34 ` Elliot Smith
2015-09-22 9:34 ` [PATCH 4/4] toaster: add 2 UI tests Elliot Smith
3 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2015-09-22 9:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
Changed toaster UI to show tasks if they're specified for the
builds and use them when restarting builds.
[YOCTO #7442]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
lib/toaster/toastergui/templates/builds.html | 12 ++++++++++-
lib/toaster/toastergui/templates/mrb_section.html | 23 +++++++++++++++++-----
.../toastergui/templates/projectbuilds.html | 12 ++++++++++-
3 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/lib/toaster/toastergui/templates/builds.html b/lib/toaster/toastergui/templates/builds.html
index c0d0c64..2b35b01 100644
--- a/lib/toaster/toastergui/templates/builds.html
+++ b/lib/toaster/toastergui/templates/builds.html
@@ -66,7 +66,17 @@
<td class="outcome">
<a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a>
</td>
- <td class="target">{% for t in build.target_set.all %} <a href="{% url "builddashboard" build.id %}"> {{t.target}} </a> <br />{% endfor %}</td>
+ <td class="target">
+ {% for t in build.target_set.all %}
+ <a href="{% url "builddashboard" build.id %}">
+ {% if t.task %}
+ {{t.target}}:{{t.task}}
+ {% else %}
+ {{t.target}}
+ {% endif %}
+ </a> <br />
+ {% endfor %}
+ </td>
<td class="machine"><a href="{% url "builddashboard" build.id %}">{{build.machine}}</a></td>
<td class="started_on"><a href="{% url "builddashboard" build.id %}">{{build.started_on|date:"d/m/y H:i"}}</a></td>
<td class="completed_on"><a href="{% url "builddashboard" build.id %}">{{build.completed_on|date:"d/m/y H:i"}}</a></td>
diff --git a/lib/toaster/toastergui/templates/mrb_section.html b/lib/toaster/toastergui/templates/mrb_section.html
index 396fb8e..13e2d0e 100644
--- a/lib/toaster/toastergui/templates/mrb_section.html
+++ b/lib/toaster/toastergui/templates/mrb_section.html
@@ -26,12 +26,25 @@
{% endif %}
{% if build.target_set.all.count > 0 %}
<span data-toggle="tooltip"
- {%if build.target_set.all.count > 1%}
- title="Targets: {%for target in build.target_set.all%}{{target.target}} {%endfor%}"
- {%endif%}
+ {% if build.target_set.all.count > 1 %}
+ title="Targets:
+ {% for target in build.target_set.all %}
+ {% if target.task %}
+ {{target.target}}:{{target.task}}
+ {% else %}
+ {{target.target}}
+ {% endif %}
+ {% endfor %}"
+ {% endif %}
>
-
- {{build.target_set.all.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%}
+ {% if build.target_set.all.0.task %}
+ {{build.target_set.all.0.target}}:{{build.target_set.all.0.task}}
+ {% else %}
+ {{build.target_set.all.0.target}}
+ {% endif %}
+ {% if build.target_set.all.count > 1 %}
+ (+ {{build.target_set.all.count|add:"-1"}})
+ {% endif %}
</span>
{% endif %}
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
diff --git a/lib/toaster/toastergui/templates/projectbuilds.html b/lib/toaster/toastergui/templates/projectbuilds.html
index 27cfcd7..fc659a0 100644
--- a/lib/toaster/toastergui/templates/projectbuilds.html
+++ b/lib/toaster/toastergui/templates/projectbuilds.html
@@ -66,7 +66,17 @@
{% endif %}
</td>
- <td class="target">{% for t in build.target_set.all %} <a href="{% url "builddashboard" build.id %}"> {{t.target}} </a> <br />{% endfor %}</td>
+ <td class="target">
+ {% for t in build.target_set.all %}
+ <a href="{% url "builddashboard" build.id %}">
+ {% if t.task %}
+ {{t.target}}:{{t.task}}
+ {% else %}
+ {{t.target}}
+ {% endif %}
+ </a> <br />
+ {% endfor %}
+ </td>
<td class="machine"><a href="{% url "builddashboard" build.id %}">{{build.machine}}</a></td>
<td class="started_on"><a href="{% url "builddashboard" build.id %}">{{build.started_on|date:"d/m/y H:i"}}</a></td>
<td class="completed_on"><a href="{% url "builddashboard" build.id %}">{{build.completed_on|date:"d/m/y H:i"}}</a></td>
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/4] toaster: add 2 UI tests
2015-09-22 9:34 [PATCH 0/4] Fix for YOCTO #7442 Elliot Smith
` (2 preceding siblings ...)
2015-09-22 9:34 ` [PATCH 3/4] toaster: change UI to show tasks Elliot Smith
@ 2015-09-22 9:34 ` Elliot Smith
3 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2015-09-22 9:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
Tested that UI shows task names for the builds in
both all-builds and projectbuilds views.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
lib/toaster/toastergui/tests.py | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/lib/toaster/toastergui/tests.py b/lib/toaster/toastergui/tests.py
index 4d1549b..53012b4 100644
--- a/lib/toaster/toastergui/tests.py
+++ b/lib/toaster/toastergui/tests.py
@@ -21,12 +21,14 @@
"""Test cases for Toaster GUI and ReST."""
+import re
+
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils import timezone
from orm.models import Project, Release, BitbakeVersion, ProjectTarget
from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build
-from orm.models import Layer_Version, Recipe, Machine, ProjectLayer
+from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
import json
from bs4 import BeautifulSoup
@@ -376,4 +378,22 @@ class ProjectBuildsDisplayTest(TestCase):
build2b = Build.objects.create(**self.project2_build_in_progress)
build_rows = self._get_rows_for_project(self.project1.id)
- self.assertEqual(len(build_rows), 2)
\ No newline at end of file
+ self.assertEqual(len(build_rows), 2)
+
+ def test_show_tasks_in_projectbuilds(self):
+ build = Build.objects.create(**self.project1_build_success)
+ target = Target.objects.create(build=build, target='bash',
+ task='clean')
+ url = reverse("projectbuilds", args=(self.project1.id,))
+ response = self.client.get(url, follow=True)
+ result = re.findall('^ +bash:clean$', response.content, re.MULTILINE)
+ self.assertEqual(len(result), 1)
+
+ def test_show_tasks_in_allbuilds(self):
+ build = Build.objects.create(**self.project1_build_success)
+ target = Target.objects.create(build=build, target='bash',
+ task='clean')
+ url = reverse("all-builds")
+ response = self.client.get(url, follow=True)
+ result = re.findall('bash:clean', response.content, re.MULTILINE)
+ self.assertEqual(len(result), 3)
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread