bitbake: toasterui: adding new task outcome empty

In order to separate tasks with invalid states from the
no exec tasks, we add a new value OUTCOME_EMPTY for the tasks.

OUTCOME_EMPTY has the same value as OUTCOME_NA as to maintain
compatibility with already existing builds. New value for
OUTCOME_NA can be used to detect tasks with invalid states, i.e.
it should never appear after finishing a build.

Fixing noexec tasks outcomes.

	[YOCTO #5763]

(Bitbake rev: 475643ad78796835bf2e731b9d0fa5794ec80dd1)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN 2014-02-13 13:12:39 +00:00 committed by Richard Purdie
parent 7008a24792
commit 3d0bb418a0
2 changed files with 20 additions and 14 deletions

View File

@ -458,7 +458,7 @@ class BuildInfoHelper(object):
task_information['task_executed'] = True
if 'noexec' in vars(event) and event.noexec == True:
task_information['task_executed'] = False
task_information['outcome'] = Task.OUTCOME_NA
task_information['outcome'] = Task.OUTCOME_EMPTY
task_information['script_type'] = Task.CODING_NA
# do not assign order numbers to scene tasks
@ -468,7 +468,10 @@ class BuildInfoHelper(object):
task_obj = self.orm_wrapper.get_update_task_object(task_information)
self.internal_state[identifier] = {'start_time': datetime.datetime.now()}
self.internal_state[identifier] = {
'start_time': datetime.datetime.now(),
'outcome': task_information['outcome'],
}
def store_tasks_stats(self, event):
@ -489,10 +492,9 @@ class BuildInfoHelper(object):
recipe_information = self._get_recipe_information_from_taskfile(event.taskfile)
recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
task_information = self._get_task_information(event,recipe)
try:
task_information['start_time'] = self.internal_state[identifier]['start_time']
except:
pass
task_information['start_time'] = self.internal_state[identifier]['start_time']
task_information['outcome'] = self.internal_state[identifier]['outcome']
if 'logfile' in vars(event):
task_information['logfile'] = event.logfile
@ -507,13 +509,14 @@ class BuildInfoHelper(object):
else:
task_information['script_type'] = Task.CODING_SHELL
if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
task_information['outcome'] = Task.OUTCOME_SUCCESS
del self.internal_state[identifier]
if task_information['outcome'] == Task.OUTCOME_NA:
if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
task_information['outcome'] = Task.OUTCOME_SUCCESS
del self.internal_state[identifier]
if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)):
task_information['outcome'] = Task.OUTCOME_FAILED
del self.internal_state[identifier]
if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)):
task_information['outcome'] = Task.OUTCOME_FAILED
del self.internal_state[identifier]
self.orm_wrapper.get_update_task_object(task_information)

View File

@ -93,20 +93,22 @@ class Task(models.Model):
(CODING_SHELL, 'Shell'),
)
OUTCOME_NA = -1
OUTCOME_SUCCESS = 0
OUTCOME_COVERED = 1
OUTCOME_CACHED = 2
OUTCOME_PREBUILT = 3
OUTCOME_FAILED = 4
OUTCOME_NA = 5
OUTCOME_EMPTY = 5
TASK_OUTCOME = (
(OUTCOME_NA, 'Not Available'),
(OUTCOME_SUCCESS, 'Succeeded'),
(OUTCOME_COVERED, 'Covered'),
(OUTCOME_CACHED, 'Cached'),
(OUTCOME_PREBUILT, 'Prebuilt'),
(OUTCOME_FAILED, 'Failed'),
(OUTCOME_NA, 'Not Available'),
(OUTCOME_EMPTY, 'Empty'),
)
search_allowed_fields = [ "recipe__name", "task_name" ]
@ -142,6 +144,7 @@ class Task(models.Model):
class Meta:
ordering = ('order', 'recipe' ,)
unique_together = ('build', 'recipe', 'task_name', )
class Task_Dependency(models.Model):