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?
017dd23 to
7d53fde
Compare
7d53fde to
ce8bcb2
Compare
| routeInfo.isLabsPage) && ( | ||
| <OriginSelect | ||
| isHardwarePath={ | ||
| routeInfo.isHardwarePage || routeInfo.isLabsPage |
There was a problem hiding this comment.
We are using the hardware origin list here.
We might be safer using tree origin, or even (if not expensive), listing origins that interact with labs, in a new endpoint.
There was a problem hiding this comment.
I agree. I have created an endpoint labs/origins to list origins related to labs.
Part of kernelci#1966 Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Closes kernelci#1966 Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Stop reusing hardware test origins on the labs page so the dropdown only shows origins that actually have lab_id rows. Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
442b6ee to
8dc5885
Compare
Lab listing queries now join the labs table, but fixtures had no lab rows and start_times sit outside the default 7-day window. Attach labs to seeded builds/tests and treat NO_LABS_FOUND like the tree listing tests. Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
|
@alanpeixinho requesting a new review. Fixed the integration tests, but the page is the same. |
Blocked by #1968
Visual reference
Screen.Recording.2026-07-20.at.09.55.25.mov