Skip to content

Commit

Permalink
feat(issue/builds): add platforms to hardware col
Browse files Browse the repository at this point in the history
- Added platforms in the hardware column for the tests table in issue
  details
- Added platforms in the hardware column for the tests table in build
  details

Closes #864
  • Loading branch information
murilx committed Feb 5, 2025
1 parent a3d520b commit 311d7ce
Show file tree
Hide file tree
Showing 15 changed files with 217 additions and 131 deletions.
4 changes: 2 additions & 2 deletions backend/kernelCI_app/helpers/hardwareDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
BuildArchitectures,
BuildStatusCount,
BuildSummary,
Misc,
EnvironmentMisc,
TestArchSummaryItem,
TestStatusCount,
TestSummary,
Expand Down Expand Up @@ -527,7 +527,7 @@ def handle_test_history(
log_url=record["log_url"],
architecture=record["build__architecture"],
compiler=record["build__compiler"],
misc=Misc(platform=record["test_platform"]),
environment_misc=EnvironmentMisc(platform=record["test_platform"]),
tree_name=record["build__checkout__tree_name"],
git_repository_branch=record["build__checkout__git_repository_branch"],
)
Expand Down
2 changes: 1 addition & 1 deletion backend/kernelCI_app/helpers/treeDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def get_current_row_data(current_row: dict) -> dict:
"log_url": current_row_data["test_log_url"],
"architecture": current_row_data["build_architecture"],
"compiler": current_row_data["build_compiler"],
"misc": {"platform": current_row_data["test_platform"]},
"environment_misc": {"platform": current_row_data["test_platform"]},
}

return current_row_data
Expand Down
2 changes: 2 additions & 0 deletions backend/kernelCI_app/typeModels/buildDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Test__Status,
Test__StartTime,
Test__EnvironmentCompatible,
Test__EnvironmentMisc,
)


Expand All @@ -46,6 +47,7 @@ class BuildTestItem(BaseModel):
path: Test__Path
start_time: Test__StartTime
environment_compatible: Test__EnvironmentCompatible
environment_misc: Test__EnvironmentMisc


class BuildTestsResponse(RootModel):
Expand Down
4 changes: 2 additions & 2 deletions backend/kernelCI_app/typeModels/commonDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BuildArchitectures(BuildStatusCount):
compilers: Optional[List[str]] = []


class Misc(BaseModel):
class EnvironmentMisc(BaseModel):
platform: str


Expand All @@ -46,7 +46,7 @@ class TestHistoryItem(BaseModel):
log_url: Optional[str]
architecture: Optional[str]
compiler: Optional[str]
misc: Optional[Misc]
environment_misc: Optional[EnvironmentMisc]


class BuildHistoryItem(BaseModel):
Expand Down
3 changes: 3 additions & 0 deletions backend/kernelCI_app/typeModels/databases.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import List, Optional, Dict, Literal, Any, Union
from datetime import datetime

from kernelCI_app.typeModels.commonDetails import EnvironmentMisc

FAIL_STATUS = "FAIL"
ERROR_STATUS = "ERROR"
MISS_STATUS = "MISS"
Expand Down Expand Up @@ -46,6 +48,7 @@
type Test__Path = Optional[str]
type Test__StartTime = Optional[datetime]
type Test__EnvironmentCompatible = Optional[List[str]]
type Test__EnvironmentMisc = Optional[EnvironmentMisc]

type Issue__Id = str
type Issue__Version = int
Expand Down
2 changes: 2 additions & 0 deletions backend/kernelCI_app/typeModels/issueDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
Test__Path,
Test__StartTime,
Test__EnvironmentCompatible,
Test__EnvironmentMisc,
Timestamp,
Checkout__TreeName,
Checkout__GitRepositoryBranch,
Expand Down Expand Up @@ -60,6 +61,7 @@ class IssueTestItem(BaseModel):
environment_compatible: Test__EnvironmentCompatible = Field(
alias="test__environment_compatible"
)
environment_misc: Test__EnvironmentMisc = Field(alias="test__environment_misc")
tree_name: Checkout__TreeName = Field(alias="test__build__checkout__tree_name")
git_repository_branch: Checkout__GitRepositoryBranch = Field(
alias="test__build__checkout__git_repository_branch"
Expand Down
8 changes: 7 additions & 1 deletion backend/kernelCI_app/views/buildTestsView.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ class BuildTests(APIView):
@extend_schema(responses=BuildTestsResponse)
def get(self, request, build_id: str) -> Response:
result = Tests.objects.filter(build_id=build_id).values(
"id", "duration", "status", "path", "start_time", "environment_compatible"
"id",
"duration",
"status",
"path",
"start_time",
"environment_compatible",
"environment_misc",
)

if not result:
Expand Down
1 change: 1 addition & 0 deletions backend/kernelCI_app/views/issueDetailsTestsView.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def _fetch_incidents(self, *, issue_id: str, version: int) -> Optional[Dict]:
"test__path",
"test__start_time",
"test__environment_compatible",
"test__environment_misc",
"test__build__checkout__tree_name",
"test__build__checkout__git_repository_branch",
]
Expand Down
100 changes: 60 additions & 40 deletions backend/requests/build-tests-get.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,69 @@
http 'http://localhost:8000/api/build/kernelci:kernelci.org:66a1d00e546da93e297e7073/tests'
http 'http://localhost:8000/api/build/maestro:67a17df4661a7bc8748b9147/tests'

# HTTP/1.1 200 OK
# Content-Length: 9122
# Allow: GET, HEAD, OPTIONS
# Cache-Control: max-age=0
# Content-Length: 2944
# Content-Type: application/json
# Cross-Origin-Opener-Policy: same-origin
# Date: Wed, 31 Jul 2024 18:00:40 GMT
# Date: Tue, 04 Feb 2025 13:17:47 GMT
# Expires: Tue, 04 Feb 2025 13:17:47 GMT
# Referrer-Policy: same-origin
# Server: WSGIServer/0.2 CPython/3.12.0
# Vary: origin
# Server: WSGIServer/0.2 CPython/3.12.7
# Vary: Accept, Cookie, origin
# X-Content-Type-Options: nosniff
# X-Frame-Options: DENY

# [
# {
# "id": "kernelci:kernelci.org:66a1d0d262f8cae67a7e7095",
# "duration": null,
# "status": "PASS",
# "path": "baseline.login",
# "startTime": "2024-07-25T04:13:06.105Z",
# "hardware": [
# "google,veyron-jaq-rev5",
# "google,veyron-jaq-rev4"
# ]
# },
# {
# "id": "kernelci:kernelci.org:66a1d0a38e8d1053a47e707c",
# "duration": null,
# "status": "PASS",
# "path": "baseline.login",
# "startTime": "2024-07-25T04:12:19.892Z",
# "hardware": [
# "google,veyron-jaq-rev5",
# "google,veyron-jaq-rev4"
# ]
# },
# {
# "id": "kernelci:kernelci.org:66a1d0a38e8d1053a47e707e",
# "duration": null,
# "status": "PASS",
# "path": "baseline.dmesg.emerg",
# "startTime": "2024-07-25T04:12:19.927Z",
# "hardware": [
# "google,veyron-jaq-rev5",
# "google,veyron-jaq-rev4"
# ]
# },
# ...
# ]
# {
# "duration": null,
# "environment_compatible": [
# "radxa,rock-5b",
# "rockchip,rk3588"
# ],
# "id": "maestro:67a1876b661a7bc8748b9ee0",
# "misc": {
# "job_id": "17603386",
# "job_url": "https://lava.collabora.dev/scheduler/job/17603386",
# "platform": "rk3588-rock-5b"
# },
# "path": "boot",
# "start_time": "2025-02-04T03:20:11.382000Z",
# "status": "PASS"
# },
# {
# "duration": null,
# "environment_compatible": [
# "khadas,vim3",
# "amlogic,a311d",
# "amlogic,g12b"
# ],
# "id": "maestro:67a18766661a7bc8748b9ece",
# "environment_misc": {
# "job_id": "17603380",
# "job_url": "https://lava.collabora.dev/scheduler/job/17603380",
# "platform": "meson-g12b-a311d-khadas-vim3"
# },
# "path": "boot",
# "start_time": "2025-02-04T03:20:06.062000Z",
# "status": "PASS"
# },
# {
# "duration": null,
# "environment_compatible": [
# "mediatek,mt8390-evk",
# "mediatek,mt8390",
# "mediatek,mt8188"
# ],
# "id": "maestro:67a18767661a7bc8748b9ed4",
# "environemtn_misc": {
# "job_id": "17603382",
# "job_url": "https://lava.collabora.dev/scheduler/job/17603382",
# "platform": "mt8390-genio-700-evk"
# },
# "path": "boot",
# "start_time": "2025-02-04T03:20:07.904000Z",
# "status": "PASS"
# },
# ...
# ]
142 changes: 81 additions & 61 deletions backend/requests/issue-details-tests-get.sh
Original file line number Diff line number Diff line change
@@ -1,75 +1,95 @@
# This will get the tests from the issue with the latest version, for a specific version pass ?version=n (n being an integer)
http 'http://localhost:8000/api/issue/maestro:0820fe153b255bf52750bbf1fecb198d8772f5a9/tests'

# HTTP/1.1 200 OK
HTTP/1.1 200 OK
# Allow: GET, HEAD, OPTIONS
# Cache-Control: max-age=0
# Content-Length: 1077
# Content-Length: 1589
# Content-Type: application/json
# Cross-Origin-Opener-Policy: same-origin
# Date: Tue, 04 Feb 2025 12:22:22 GMT
# Expires: Tue, 04 Feb 2025 12:22:22 GMT
# Date: Tue, 04 Feb 2025 13:12:08 GMT
# Expires: Tue, 04 Feb 2025 13:12:08 GMT
# Referrer-Policy: same-origin
# Server: WSGIServer/0.2 CPython/3.12.7
# Vary: Accept, Cookie, origin
# X-Content-Type-Options: nosniff
# X-Frame-Options: DENY

# [
# {
# "id":"maestro:674ef566063ce49a02bf7b6d",
# "status":"FAIL",
# "duration":null,
# "path":"boot.nfs",
# "start_time":"2024-12-03T12:11:18.636000Z",
# "environment_compatible":[
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "tree_name":"net-next",
# "git_repository_branch":"main"
# },
# {
# "id":"maestro:674fddf9089e99b3f2b506f7",
# "status":"FAIL",
# "duration":null,
# "path":"boot.nfs",
# "start_time":"2024-12-04T04:43:37.701000Z",
# "environment_compatible":[
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "tree_name":"net-next",
# "git_repository_branch":"main"
# },
# {
# "id":"maestro:674fd928089e99b3f2b4b523",
# "status":"FAIL",
# "duration":null,
# "path":"boot",
# "start_time":"2024-12-04T04:23:04.822000Z",
# "environment_compatible":[
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "tree_name":"net-next",
# "git_repository_branch":"main"
# },
# {
# "id":"maestro:6750002f089e99b3f2b7e106",
# "status":"FAIL",
# "duration":null,
# "path":"boot",
# "start_time":"2024-12-04T07:09:35.087000Z",
# "environment_compatible":[
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "tree_name":"net-next",
# "git_repository_branch":"main"
# }
# ]
# {
# "duration": null,
# "environment_compatible": [
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "git_repository_branch": "main",
# "id": "maestro:674ef566063ce49a02bf7b6d",
# "environment_misc": {
# "job_id": "16727012",
# "job_url": "https://lava.collabora.dev/scheduler/job/16727012",
# "platform": "mt8195-cherry-tomato-r2"
# },
# "path": "boot.nfs",
# "start_time": "2024-12-03T12:11:18.636000Z",
# "status": "FAIL",
# "tree_name": "net-next"
# },
# {
# "duration": null,
# "environment_compatible": [
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "git_repository_branch": "main",
# "id": "maestro:674fddf9089e99b3f2b506f7",
# "environment_misc": {
# "job_id": "16759244",
# "job_url": "https://lava.collabora.dev/scheduler/job/16759244",
# "platform": "mt8195-cherry-tomato-r2"
# },
# "path": "boot.nfs",
# "start_time": "2024-12-04T04:43:37.701000Z",
# "status": "FAIL",
# "tree_name": "net-next"
# },
# {
# "duration": null,
# "environment_compatible": [
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "git_repository_branch": "main",
# "id": "maestro:674fd928089e99b3f2b4b523",
# "environment_misc": {
# "job_id": "16757607",
# "job_url": "https://lava.collabora.dev/scheduler/job/16757607",
# "platform": "mt8195-cherry-tomato-r2"
# },
# "path": "boot",
# "start_time": "2024-12-04T04:23:04.822000Z",
# "status": "FAIL",
# "tree_name": "net-next"
# },
# {
# "duration": null,
# "environment_compatible": [
# "google,tomato-rev2",
# "google,tomato",
# "mediatek,mt8195"
# ],
# "git_repository_branch": "main",
# "id": "maestro:6750002f089e99b3f2b7e106",
# "environment_misc": {
# "job_id": "16770923",
# "job_url": "https://lava.collabora.dev/scheduler/job/16770923",
# "platform": "mt8195-cherry-tomato-r2"
# },
# "path": "boot",
# "start_time": "2024-12-04T07:09:35.087000Z",
# "status": "FAIL",
# "tree_name": "net-next"
# }
# ]
Loading

0 comments on commit 311d7ce

Please sign in to comment.