def stop(TEST_history): id = TEST_history[0]['id'] now = time_conversion.now_date() now = time_conversion.date_to_readable(now) tdelta = time_conversion.calc_timedelta(now, TEST_history[-1]['data_start']) #tdelta = datetime.strptime(str(now), FMT) - datetime.strptime(str(TEST_history[-1]['data_start']), FMT) db_update.TEST_history(id, 'stop', str(now)) db_update.TEST_history(id, 'interval', str(tdelta))
def start(TEST_history, zabbix_group_id, grafana_dashboard_uid, interval): id = TEST_history[0]['id'] now = time_conversion.now_date() now_plus_interval = time_conversion.add_timedelta(now, interval) now = time_conversion.date_to_readable(now) now_plus_interval = time_conversion.date_to_readable(now_plus_interval) db_update.TEST_history(id, 'start', str(now)) db_update.TEST_history(id, 'planned_end', str(now_plus_interval)) db_update.TEST_history(id, 'zabbix', zabbix_group_id) db_update.TEST_history(id, 'grafana', grafana_dashboard_uid)
def look_for_errors(): TEST_history = db_get.TEST_history('all') for test in TEST_history: if test['is_running'] == 3: db_update.TEST_history(test['id'], 'change_status', 0)
def start_prepare(TEST_history): id = TEST_history[0]['id'] db_update.TEST_history(id, 'change_status', 3)
def error(TEST_history): id = TEST_configuration[0]['id'] db_update.TEST_history(id, 'change_status', 4)