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:
parent
7008a24792
commit
3d0bb418a0
|
@ -458,7 +458,7 @@ class BuildInfoHelper(object):
|
||||||
task_information['task_executed'] = True
|
task_information['task_executed'] = True
|
||||||
if 'noexec' in vars(event) and event.noexec == True:
|
if 'noexec' in vars(event) and event.noexec == True:
|
||||||
task_information['task_executed'] = False
|
task_information['task_executed'] = False
|
||||||
task_information['outcome'] = Task.OUTCOME_NA
|
task_information['outcome'] = Task.OUTCOME_EMPTY
|
||||||
task_information['script_type'] = Task.CODING_NA
|
task_information['script_type'] = Task.CODING_NA
|
||||||
|
|
||||||
# do not assign order numbers to scene tasks
|
# 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)
|
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):
|
def store_tasks_stats(self, event):
|
||||||
|
@ -489,10 +492,9 @@ class BuildInfoHelper(object):
|
||||||
recipe_information = self._get_recipe_information_from_taskfile(event.taskfile)
|
recipe_information = self._get_recipe_information_from_taskfile(event.taskfile)
|
||||||
recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
|
recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
|
||||||
task_information = self._get_task_information(event,recipe)
|
task_information = self._get_task_information(event,recipe)
|
||||||
try:
|
|
||||||
task_information['start_time'] = self.internal_state[identifier]['start_time']
|
task_information['start_time'] = self.internal_state[identifier]['start_time']
|
||||||
except:
|
task_information['outcome'] = self.internal_state[identifier]['outcome']
|
||||||
pass
|
|
||||||
|
|
||||||
if 'logfile' in vars(event):
|
if 'logfile' in vars(event):
|
||||||
task_information['logfile'] = event.logfile
|
task_information['logfile'] = event.logfile
|
||||||
|
@ -507,13 +509,14 @@ class BuildInfoHelper(object):
|
||||||
else:
|
else:
|
||||||
task_information['script_type'] = Task.CODING_SHELL
|
task_information['script_type'] = Task.CODING_SHELL
|
||||||
|
|
||||||
if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
|
if task_information['outcome'] == Task.OUTCOME_NA:
|
||||||
task_information['outcome'] = Task.OUTCOME_SUCCESS
|
if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
|
||||||
del self.internal_state[identifier]
|
task_information['outcome'] = Task.OUTCOME_SUCCESS
|
||||||
|
del self.internal_state[identifier]
|
||||||
|
|
||||||
if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)):
|
if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)):
|
||||||
task_information['outcome'] = Task.OUTCOME_FAILED
|
task_information['outcome'] = Task.OUTCOME_FAILED
|
||||||
del self.internal_state[identifier]
|
del self.internal_state[identifier]
|
||||||
|
|
||||||
self.orm_wrapper.get_update_task_object(task_information)
|
self.orm_wrapper.get_update_task_object(task_information)
|
||||||
|
|
||||||
|
|
|
@ -93,20 +93,22 @@ class Task(models.Model):
|
||||||
(CODING_SHELL, 'Shell'),
|
(CODING_SHELL, 'Shell'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
OUTCOME_NA = -1
|
||||||
OUTCOME_SUCCESS = 0
|
OUTCOME_SUCCESS = 0
|
||||||
OUTCOME_COVERED = 1
|
OUTCOME_COVERED = 1
|
||||||
OUTCOME_CACHED = 2
|
OUTCOME_CACHED = 2
|
||||||
OUTCOME_PREBUILT = 3
|
OUTCOME_PREBUILT = 3
|
||||||
OUTCOME_FAILED = 4
|
OUTCOME_FAILED = 4
|
||||||
OUTCOME_NA = 5
|
OUTCOME_EMPTY = 5
|
||||||
|
|
||||||
TASK_OUTCOME = (
|
TASK_OUTCOME = (
|
||||||
|
(OUTCOME_NA, 'Not Available'),
|
||||||
(OUTCOME_SUCCESS, 'Succeeded'),
|
(OUTCOME_SUCCESS, 'Succeeded'),
|
||||||
(OUTCOME_COVERED, 'Covered'),
|
(OUTCOME_COVERED, 'Covered'),
|
||||||
(OUTCOME_CACHED, 'Cached'),
|
(OUTCOME_CACHED, 'Cached'),
|
||||||
(OUTCOME_PREBUILT, 'Prebuilt'),
|
(OUTCOME_PREBUILT, 'Prebuilt'),
|
||||||
(OUTCOME_FAILED, 'Failed'),
|
(OUTCOME_FAILED, 'Failed'),
|
||||||
(OUTCOME_NA, 'Not Available'),
|
(OUTCOME_EMPTY, 'Empty'),
|
||||||
)
|
)
|
||||||
|
|
||||||
search_allowed_fields = [ "recipe__name", "task_name" ]
|
search_allowed_fields = [ "recipe__name", "task_name" ]
|
||||||
|
@ -142,6 +144,7 @@ class Task(models.Model):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('order', 'recipe' ,)
|
ordering = ('order', 'recipe' ,)
|
||||||
|
unique_together = ('build', 'recipe', 'task_name', )
|
||||||
|
|
||||||
|
|
||||||
class Task_Dependency(models.Model):
|
class Task_Dependency(models.Model):
|
||||||
|
|
Loading…
Reference in New Issue