Skip to content

Commit

Permalink
Merge pull request #104 from vishnuchalla/status
Browse files Browse the repository at this point in the history
Updating telco job status based on the threshold
  • Loading branch information
chentex authored Jun 27, 2024
2 parents d74e08f + 3c9fe8e commit c13254c
Show file tree
Hide file tree
Showing 4 changed files with 278 additions and 261 deletions.
4 changes: 3 additions & 1 deletion backend/app/api/v1/commons/telco.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import app.api.v1.commons.hasher as hasher
from datetime import datetime, timezone
import app.api.v1.commons.utils as utils
import app.api.v1.endpoints.telco.telcoGraphs as telcoGraphs


async def getData(start_datetime: date, end_datetime: date, configpath: str):
Expand Down Expand Up @@ -36,6 +37,7 @@ async def getData(start_datetime: date, end_datetime: date, configpath: str):
for each_response in response:
end_timestamp = int(each_response['timestamp'])
test_data = each_response['data']
threshold = await telcoGraphs.process_json(test_data, True)
hash_digest, encrypted_data = hasher.hash_encrypt_json(each_response)
execution_time_seconds = test_type_execution_times.get(test_data['test_type'], 0)
start_timestamp = end_timestamp - execution_time_seconds
Expand All @@ -58,7 +60,7 @@ async def getData(start_datetime: date, end_datetime: date, configpath: str):
"startDate": str(start_time_utc),
"endDate": str(end_time_utc),
"buildUrl": jenkins_url + "/" + str(test_data['cluster_artifacts']['ref']['jenkins_build']),
"jobStatus": "success",
"jobStatus": "failure" if (threshold != 0) else "success",
"jobDuration": execution_time_seconds,
})

Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/v1/endpoints/quay/quayJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def jobs(start_date: date = Query(None, description="Start date for search
pretty: bool = Query(False, description="Output contet in pretty format.")):
if start_date is None:
start_date = datetime.utcnow().date()
start_date = start_date - timedelta(days=7)
start_date = start_date - timedelta(days=5)

if end_date is None:
end_date = datetime.utcnow().date()
Expand Down
Loading

0 comments on commit c13254c

Please sign in to comment.