Compare commits
No commits in common. "40ce2c583d97e159bdde24070dcb1062f60a5682" and "ae8b2a708964818c553f38a8b30ca56dc89291cd" have entirely different histories.
40ce2c583d
...
ae8b2a7089
@ -246,18 +246,17 @@ class DB():
|
||||
val = int(cur.fetchone()[0])
|
||||
return val == 1
|
||||
|
||||
def get_build_tasks_for_tests_update(self, not_before: datetime) -> List[int]:
|
||||
def get_build_tasks_for_unfinished_tests(self, not_before: datetime) -> List[int]:
|
||||
'''
|
||||
Getting build tasks id for test tasks that we need to update
|
||||
https://cloudlinux.atlassian.net/browse/ALBS-1060
|
||||
getting build tasks id of unfinished test tasks
|
||||
'''
|
||||
cur = self.__conn.cursor()
|
||||
sql = '''
|
||||
SELECT bt.id
|
||||
FROM build_tasks AS bt
|
||||
INNER JOIN builds AS b
|
||||
ON b.id = bt.build_id
|
||||
WHERE b.created_at > %s;
|
||||
SELECT DISTINCT bt.id
|
||||
FROM build_tasks as bt
|
||||
INNER JOIN test_tasks AS tt
|
||||
ON bt.id = tt.build_task_id
|
||||
WHERE tt.status_id < 3 AND bt.started_at > %s;
|
||||
'''
|
||||
cur.execute(sql, (not_before.timestamp(),))
|
||||
logging.debug('raw SQL query: %s', cur.query)
|
||||
|
@ -131,9 +131,8 @@ class Extractor:
|
||||
build_id, err, exc_info=True)
|
||||
|
||||
def updating_test_tasks(self):
|
||||
logging.info('getting build tasks for builds created after %s',
|
||||
self.config.oldest_to_update)
|
||||
build_task_ids = self.db.get_build_tasks_for_tests_update(
|
||||
logging.info('getting build task ids of unfinished tests')
|
||||
build_task_ids = self.db.get_build_tasks_for_unfinished_tests(
|
||||
self.config.oldest_to_update)
|
||||
for build_task_id in build_task_ids:
|
||||
try:
|
||||
|
@ -95,7 +95,7 @@ def start(yml_path: str):
|
||||
else:
|
||||
logging.info('update finished')
|
||||
|
||||
logging.info('updating/inserting test tasks')
|
||||
logging.info('updating statuses of unfinished test tasks')
|
||||
try:
|
||||
extractor.updating_test_tasks()
|
||||
except Exception as err: # pylint: disable=broad-except
|
||||
|
@ -16,7 +16,4 @@ First version
|
||||
0.3.1 (2023-03-22)
|
||||
- db: bugfix with migration to version 3
|
||||
- added info about api_timeout config parameter
|
||||
- bugfix with processing of test tasks with new revision
|
||||
|
||||
0.3.2 (2023-03-23)
|
||||
- Bugfix ALBS-1060
|
||||
- bugfix with processing of test tasks with new revision
|
Loading…
Reference in New Issue
Block a user