Skip to content

test(BA-6953): add component tests for the kernel scheduling-history REST v2 endpoints#12997

Merged
fregataa merged 1 commit into
mainfrom
feat/BA-6953-kernel-history-component-tests
Jul 24, 2026
Merged

test(BA-6953): add component tests for the kernel scheduling-history REST v2 endpoints#12997
fregataa merged 1 commit into
mainfrom
feat/BA-6953-kernel-history-component-tests

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 21, 2026

Copy link
Copy Markdown
Member

📚 Stacked PRs

Merge in order, bottom-up. Each PR is based on the one above it, so its diff shows only its own layer.

Resolves #12994 (BA-6953)

Summary

  • Eight component tests driving both kernel routes through V2SchedulingHistoryClient against a real aiohttp server and DB: /kernels/admin/search and /kernels/scoped/search. The layers below are unit-tested, but nothing exercised the HTTP boundary for these two.
  • Covers what tests/component/AGENTS.md scopes to this layer — routing, the auth middleware on each route, and request/response serialization — rather than re-testing filter semantics that tests/unit already owns.
  • The directory conftest previously registered only the v1 route tree; it now mounts the v2 sub-registry too, so both suites share one server. The pre-existing v1 tests still pass unchanged.
  • kernel_scheduling_history has no writer yet (BA-6852), so the fixture seeds history rows directly, alongside the real kernels / sessions rows the scoped endpoint's existence check needs.

Unlike the existing v1 tests in this directory, which assert only that the response shape is valid against an empty table, these seed data and assert on actual rows — two kernels under one session, three history rows on one and one on the other, so scoping is observable rather than vacuous.

Writing them caught two things that unit tests had not: from_status / to_status must be valid KernelSchedulingPhase members (a "PENDING" seed produced a 500), and SessionRow requires domain_id alongside domain_name.

Test plan

  • tests/component/scheduling_history/test_kernel_history_v2.py — 8 passed
  • Whole directory including the pre-existing v1 suite — 20 passed
  • ruff check / ruff format clean
  • BUILD already present in the directory; no new test directory added

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size:L 100~500 LoC label Jul 21, 2026
@jopemachine
jopemachine force-pushed the feat/BA-6893-kernel-history-sdk-cli branch 7 times, most recently from 272a1da to 3fa980c Compare July 23, 2026 09:19
Base automatically changed from feat/BA-6893-kernel-history-sdk-cli to main July 23, 2026 09:26
@jopemachine
jopemachine force-pushed the feat/BA-6953-kernel-history-component-tests branch 8 times, most recently from 4f36c2c to 079dc1e Compare July 24, 2026 02:02
@github-actions github-actions Bot added the comp:common Related to Common component label Jul 24, 2026
@jopemachine
jopemachine force-pushed the feat/BA-6953-kernel-history-component-tests branch 3 times, most recently from 5f33cb8 to e9fff91 Compare July 24, 2026 02:10
@jopemachine
jopemachine marked this pull request as ready for review July 24, 2026 02:14
@jopemachine
jopemachine requested a review from a team as a code owner July 24, 2026 02:14
Copilot AI review requested due to automatic review settings July 24, 2026 02:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds component coverage for kernel scheduling-history REST v2 endpoints using a real server and database.

Changes:

  • Tests admin/scoped searches, filtering, ordering, and pagination.
  • Mounts v2 routes and adds authenticated clients plus seeded history data.
  • Adds a test changelog fragment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/component/scheduling_history/test_kernel_scheduling_history.py Adds REST v2 component tests.
tests/component/scheduling_history/conftest.py Adds v2 routing, clients, and database fixtures.
changes/12997.test.md Records the added tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/component/scheduling_history/conftest.py
…v2 SDK client

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jopemachine
jopemachine force-pushed the feat/BA-6953-kernel-history-component-tests branch from e9fff91 to ac0af48 Compare July 24, 2026 02:30
@fregataa
fregataa merged commit ec253a6 into main Jul 24, 2026
34 checks passed
@fregataa
fregataa deleted the feat/BA-6953-kernel-history-component-tests branch July 24, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:common Related to Common component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kernel scheduling history: component tests for the REST v2 endpoints

3 participants