Skip to content

Commit 84aa69a

Browse files
Vishnu Challachentex
authored andcommitted
Updating job status based on threshold
Signed-off-by: Vishnu Challa <[email protected]>
1 parent cdd250c commit 84aa69a

File tree

4 files changed

+278
-261
lines changed

4 files changed

+278
-261
lines changed

backend/app/api/v1/commons/telco.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import app.api.v1.commons.hasher as hasher
66
from datetime import datetime, timezone
77
import app.api.v1.commons.utils as utils
8+
import app.api.v1.endpoints.telco.telcoGraphs as telcoGraphs
89

910

1011
async def getData(start_datetime: date, end_datetime: date, configpath: str):
@@ -36,6 +37,7 @@ async def getData(start_datetime: date, end_datetime: date, configpath: str):
3637
for each_response in response:
3738
end_timestamp = int(each_response['timestamp'])
3839
test_data = each_response['data']
40+
threshold = await telcoGraphs.process_json(test_data, True)
3941
hash_digest, encrypted_data = hasher.hash_encrypt_json(each_response)
4042
execution_time_seconds = test_type_execution_times.get(test_data['test_type'], 0)
4143
start_timestamp = end_timestamp - execution_time_seconds
@@ -58,7 +60,7 @@ async def getData(start_datetime: date, end_datetime: date, configpath: str):
5860
"startDate": str(start_time_utc),
5961
"endDate": str(end_time_utc),
6062
"buildUrl": jenkins_url + "/" + str(test_data['cluster_artifacts']['ref']['jenkins_build']),
61-
"jobStatus": "success",
63+
"jobStatus": "failure" if (threshold != 0) else "success",
6264
"jobDuration": execution_time_seconds,
6365
})
6466

backend/app/api/v1/endpoints/quay/quayJobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async def jobs(start_date: date = Query(None, description="Start date for search
2525
pretty: bool = Query(False, description="Output contet in pretty format.")):
2626
if start_date is None:
2727
start_date = datetime.utcnow().date()
28-
start_date = start_date - timedelta(days=7)
28+
start_date = start_date - timedelta(days=5)
2929

3030
if end_date is None:
3131
end_date = datetime.utcnow().date()

0 commit comments

Comments
 (0)