feat: labs listing#1985
Conversation
48b98a2 to
017dd23
Compare
| } | ||
|
|
||
| query = """ | ||
| WITH build_counts AS ( |
There was a problem hiding this comment.
we might be able to simplify those queries with something on the lines of
SELECT
COALESCE(labs.name, tests.misc->>'runtime') AS lab,
CASE
WHEN status IN ('PASS', 'FAIL') THEN status
ELSE 'INCONCLUSIVE'
END AS test_status,
count(*) as test_count
FROM tests
left join labs on labs.id = tests.lab_id
WHERE COALESCE(labs.name, tests.misc->>'runtime') IS NOT null
GROUP BY
lab,
test_status;
| import type { LabsListingRoutesMap } from '@/utils/constants/labsListing'; | ||
|
|
||
| const statusCell = ( | ||
| summary: LabListingItem['build_status_summary'], |
There was a problem hiding this comment.
the type shouldnt be a ShortStatusCount here?
| from kernelCI_app.queries.labs import get_lab_listing_data | ||
|
|
||
|
|
||
| class TestGetLabListingData: |
There was a problem hiding this comment.
I dont know if this test aggregates much. Might be better to add Integration tests for database query tests.
| end_date=ANY, | ||
| ) | ||
| self.assertEqual(response.data["labs"][0]["lab_name"], "lab-collabora") | ||
| self.assertEqual(response.data["labs"][0]["build_status_summary"]["PASS"], 0) |
There was a problem hiding this comment.
might be worth it checking asserting response here
| ) | ||
|
|
||
|
|
||
| class LabListingQueryParams(BaseModel): |
There was a problem hiding this comment.
Might be worth to checking if we can use ListingQueryParams, this way we would keep the same interface as similar listings.
| status_code=HTTPStatus.OK, | ||
| ) | ||
| except ValidationError as e: | ||
| return Response(data=e.json(), status=HTTPStatus.INTERNAL_SERVER_ERROR) |
There was a problem hiding this comment.
nit: there is a helper that other views are using create_error_reponse.
| test_status_summary: ShortStatusCount; | ||
| }; | ||
|
|
||
| export type LabListingApiItem = LabListingItem; |
There was a problem hiding this comment.
Why are we exporting the same type twice here?
Part of kernelci#1966 Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Closes kernelci#1966 Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Signed-off-by: Felipe Bergamin <felipebergamin6@gmail.com>
Signed-off-by: Felipe Bergamin <felipebergamin6@gmail.com>
017dd23 to
7d53fde
Compare
Blocked by #1968
Visual reference
Screen.Recording.2026-07-20.at.09.55.25.mov