From 163bc3fc1edfd267cbc4a893f6115da8a1a61d05 Mon Sep 17 00:00:00 2001 From: Murilo Geraldini Date: Wed, 15 Jan 2025 15:28:37 -0300 Subject: [PATCH] refactor(tree-details boots/tests): alter response Part of #731 Part of #700 --- backend/kernelCI_app/helpers/treeDetails.py | 2 +- backend/kernelCI_app/typeModels/treeDetails.py | 2 +- backend/kernelCI_app/views/treeDetailsBootsView.py | 2 +- backend/kernelCI_app/views/treeDetailsTestsView.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/kernelCI_app/helpers/treeDetails.py b/backend/kernelCI_app/helpers/treeDetails.py index 003d1ba1..7d2fe2a9 100644 --- a/backend/kernelCI_app/helpers/treeDetails.py +++ b/backend/kernelCI_app/helpers/treeDetails.py @@ -197,7 +197,7 @@ def get_current_row_data(current_row: dict) -> dict: "status": current_row_data["test_status"], "duration": current_row_data["test_duration"], "path": current_row_data["test_path"], - "startTime": current_row_data["test_start_time"], + "start_time": current_row_data["test_start_time"], "hardware": current_row[tmp_test_env_comp_key], } diff --git a/backend/kernelCI_app/typeModels/treeDetails.py b/backend/kernelCI_app/typeModels/treeDetails.py index e87f6629..b6f75f00 100644 --- a/backend/kernelCI_app/typeModels/treeDetails.py +++ b/backend/kernelCI_app/typeModels/treeDetails.py @@ -102,7 +102,7 @@ class TestHistory(BaseModel): status: Optional[str] duration: Optional[Union[int, float]] path: Optional[str] - startTime: Optional[Union[datetime, str]] + start_time: Optional[Union[datetime, str]] hardware: Optional[Union[str, List[str]]] diff --git a/backend/kernelCI_app/views/treeDetailsBootsView.py b/backend/kernelCI_app/views/treeDetailsBootsView.py index bc06b5c8..876af621 100644 --- a/backend/kernelCI_app/views/treeDetailsBootsView.py +++ b/backend/kernelCI_app/views/treeDetailsBootsView.py @@ -84,6 +84,6 @@ def get(self, request, commit_hash: str | None): return Response( { - "bootHistory": self.bootHistory, + "boots": self.bootHistory, } ) diff --git a/backend/kernelCI_app/views/treeDetailsTestsView.py b/backend/kernelCI_app/views/treeDetailsTestsView.py index b1c36fd6..482768bb 100644 --- a/backend/kernelCI_app/views/treeDetailsTestsView.py +++ b/backend/kernelCI_app/views/treeDetailsTestsView.py @@ -89,6 +89,6 @@ def get(self, request, commit_hash: str | None): return Response( { - "testHistory": self.testHistory, + "tests": self.testHistory, } )