Patchwork [bitbake-devel,09/94] bitbake: webhob: view a table with all the tasks of a build

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:51 p.m.
Message ID <300e52f6f59ffb91260feca8db8801f520c331c6.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58849/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:51 p.m.
From: Calin Dragomir <calinx.l.dragomir@intel.com>

This patch will display all tasks executed for a build.
There is detailed information about each task executed, if any.
In case there were no tasks executed for a build, a warning message
is displayed.

Signed-off-by: Calin Dragomir <calinx.l.dragomir@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/webhob/bldviewer/templates/task.html | 81 ++++++++++++++++++++++++
 bitbake/lib/webhob/bldviewer/urls.py             |  1 +
 bitbake/lib/webhob/bldviewer/views.py            | 11 +++-
 bitbake/lib/webhob/whbmain/urls.py               |  2 +-
 4 files changed, 93 insertions(+), 2 deletions(-)
 create mode 100644 bitbake/lib/webhob/bldviewer/templates/task.html

Patch

diff --git a/bitbake/lib/webhob/bldviewer/templates/task.html b/bitbake/lib/webhob/bldviewer/templates/task.html
new file mode 100644
index 0000000..26a09e9
--- /dev/null
+++ b/bitbake/lib/webhob/bldviewer/templates/task.html
@@ -0,0 +1,81 @@ 
+<html>
+
+	<head>
+		<title>WebHob Task page</title>
+	</head>
+
+<body>
+
+	<h1>WebHob Tasks</h1>
+
+	{% if not tasks %}
+		<p>No tasks were executed in this build!</p>
+	{% else %}
+
+		<table border="1">
+
+			<tr>
+			<th>Order</th>
+			<th>Task</th>
+			<th>Recipe</th>
+			<th>Recipe Version</th>
+			<th>Task Type</th>
+			<th>Outcome</th>
+			<th>Errors</th>
+			<th>Warnings</th>
+			<th>Time</th>
+			<th>Log</th>
+			<th>Work directory</th>
+			<th>CPU usage</th>
+			<th>Disk I/O</th>
+			<th>Sstate Checksum</th>
+			<th>Path to sstate object</th>
+			<th>Source URL</th>
+			<th>Script type</th>
+			<th>File path</th>
+			<th>Line number</th>
+			<th>Python Stack Trace</th>
+			<th>Sstate Result</th>
+			</tr>
+
+			{% for task in tasks %}
+
+				<tr>
+				<td>{{task.order}}</td>
+				<td>{{task.task_name}}</td>
+				<td>{{task.recipe.name}}</td>
+				<td>{{task.recipe.version}}</td>
+
+				{% if task.task_executed %}
+					<td>Executed</td>
+				{% else %}
+					<td>Prebuilt</td>
+				{% endif %}
+
+				<td>{{task.get_outcome_display}}</td>
+				<td>{{task.errors_no}}</td>
+				<td>{{task.warnings_no}}</td>
+				<td>{{task.elapsed_time}}</td>
+				<td>{{task.log_file}}</td>
+				<td>{{task.work_directory}}</td>
+				<td>{{task.cpu_usage}}</td>
+				<td>{{task.disk_io}}</td>
+				<td>{{task.sstate_checksum}}</td>
+				<td>{{task.path_to_sstate_obj}}</td>
+				<td>{{task.source_url}}</td>
+				<td>{{task.get_script_type_display}}</td>
+				<td>{{task.file_path}}</td>
+				<td>{{task.line_number}}</td>
+				<td>{{task.py_stack_trace}}</td>
+				<td>{{task.get_sstate_result_display}}</td>
+				</tr>
+
+			{% endfor %}
+
+		</table>
+
+	{% endif %}
+
+</body>
+
+</html>
diff --git a/bitbake/lib/webhob/bldviewer/urls.py b/bitbake/lib/webhob/bldviewer/urls.py
index 3ec2a30..335885c 100644
--- a/bitbake/lib/webhob/bldviewer/urls.py
+++ b/bitbake/lib/webhob/bldviewer/urls.py
@@ -3,4 +3,5 @@  from django.conf.urls import patterns, include, url
 
 urlpatterns = patterns('bldviewer.views',
         url(r'^$', 'build', name='build'),
+        url(r'^(?P<build_id>\d+)/$', 'task', name='task'),
 )
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index 15a2d1d..292a638 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -1,5 +1,5 @@ 
 from django.shortcuts import render
-from orm.models import Build
+from orm.models import Build, Task
 
 
 def build(request):
@@ -9,3 +9,12 @@  def build(request):
     context = {'builds': build_info}
 
     return render(request, template, context)
+
+def task(request, build_id):
+    template = 'task.html'
+
+    tasks = Task.objects.filter(build=build_id)
+
+    context = {'tasks': tasks}
+
+    return render(request, template, context)
diff --git a/bitbake/lib/webhob/whbmain/urls.py b/bitbake/lib/webhob/whbmain/urls.py
index a15fc1b..c40e7c7 100644
--- a/bitbake/lib/webhob/whbmain/urls.py
+++ b/bitbake/lib/webhob/whbmain/urls.py
@@ -5,7 +5,7 @@  from django.conf.urls import patterns, include, url
 # admin.autodiscover()
 
 urlpatterns = patterns('',
-    url(r'^build/$', include('bldviewer.urls')),
+    url(r'^build/', include('bldviewer.urls')),
     # Examples:
     # url(r'^webhob/', include('webhob.foo.urls')),