Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating telco job status based on the threshold #104

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading