summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2020-02-18 21:55:01 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2020-02-18 21:55:01 +0800
commiteed1c94f7d60c5200cb7a02396c11437b3b63e50 (patch)
treef063cb3cdf294b3af8e7c019c56e9e1227f50412
parent1123ea3fa3832ece02f57b1eceb69eaf0375e65b (diff)
lkft/views.py: calculate the qa-project duration from the start of the last ci build
not from the last trigger build, as the last ci build might not be the one for the project Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--lkft/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lkft/views.py b/lkft/views.py
index 94e9430..f3b9e9a 100644
--- a/lkft/views.py
+++ b/lkft/views.py
@@ -457,9 +457,11 @@ def get_project_info(project):
}
project['last_ci_build'] = last_ci_build
- if project['last_build'] and last_trigger_build and \
+ if project.get('last_build') and project.get('last_ci_build') and \
project['last_build']['build_status'] == "JOBSCOMPLETED":
- project['duration'] = project['last_build']['last_fetched_timestamp'] - last_trigger_build['start_timestamp']
+ last_ci_build = project.get('last_ci_build')
+ last_build = project.get('last_build')
+ project['duration'] = last_build.get('last_fetched_timestamp') - last_ci_build.get('start_timestamp')
logger.info("%s: finished to get information for project", project.get('name'))